+ Post New Thread
Results 1 to 6 of 6
Wireless Networks Thread, Ubiquiti UniFi: How big is your DB - does it keep growing? in Technical; G'day In case some UniFi users are around and willing to post back their real life sizes of their UniFI ...
  1. #1

    Join Date
    Apr 2012
    Posts
    22
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Ubiquiti UniFi: How big is your DB - does it keep growing?

    G'day

    In case some UniFi users are around and willing to post back their real life sizes of their UniFI controllers.

    I happen to see a not-so unimportant growth of my Debian squeeze based UniFi controller here with 40 APs (ecpected yet to grow to 60-70).
    We don't have many users yet (only teachers allowed right now) but the /var/lib/mongodb and /var/lib/unifi/db both occupy > 7GB after about 6 months of operation which I consider quite hefty simply for logging connections.
    Actually this urged me to expand the partitions to not break things.

    Also I haven't found a way to depreciate log data after a defined period, so my current guess is that the system keeps the logged data in MongoDB for like forever? *ouch*
    Anyone willing to post their number of UAPs and disk use of their controllers via some 'du -h /var/lib/unifi' and 'du -h /var/lib/mongodb'?

  2. #2

    Join Date
    Nov 2009
    Location
    Manchester
    Posts
    1,054
    Thank Post
    6
    Thanked 201 Times in 181 Posts
    Rep Power
    52
    We have 35 points, our DB is 3GB and this has been running for a couple of years.

    Our DB did get huge at one point, for an unexplained reason but a reinstall of Unifi itself fixed this, we reinstalled straight over the top, reusing the same database if i remember correctly. I think there was a fault in our config that made it get bigger (I checked in the MongoDB logs) and the reinstall fixed it again.

  3. #3
    lmgtfy's Avatar
    Join Date
    Feb 2010
    Posts
    257
    Thank Post
    41
    Thanked 26 Times in 22 Posts
    Rep Power
    43
    We have 55 AP's now and have been running them since July 2012 with the software installed on Server 2008 R2. Our Database is 2.9GB. Now you mention it I might keep an eye on it and see if it increases over time.

  4. #4

    Join Date
    Apr 2012
    Posts
    22
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Thank you!

    Hmm, /var/lib/unifi/db/journal takes 3.1GB now, the rest in the unifi folder comes to a total of 4GB.
    Although chrisrowlands has more APs in use than I - may depend on the number of users, SSIDs, $whatever - your number seems to be in the range to what I get.

    The content of /var/lib/mongodb has a couple of larger files that have not been modified for a longer period of time (Jul. 2012 actually), I suspect that during an update UniFi has switched the DB location somehow, not yet sure.
    Since the Windows controller comes with MongoDB included, things may be a bit different for the Linux / UNIX packages who require to install MongoDB on your own from package management.
    @Achandler: Thanks other than the regular memory consumption log and other informational MongoDB log, no errors spotted so far *uff*, hope it stays this way.

  5. #5
    nicholab's Avatar
    Join Date
    Nov 2006
    Location
    Birmingham
    Posts
    1,493
    Thank Post
    4
    Thanked 97 Times in 93 Posts
    Blog Entries
    1
    Rep Power
    50
    You got me worry I have just install my controller on a pfsense system.

  6. #6

    Join Date
    Apr 2012
    Posts
    22
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Actually the DB size of @Achandler amd @chrisrowlands made me aware of a not so unimportant difference, and made me think of a difference:

    • Mac and Windows packages are installers providing MongoDB bundled.
    • Linux packages and the UNIX archive (like for your use on pfSense) require you to install MongoDB via OS/distro packages or from source


    The Mac and Windows installers will configure MongoDB for the use of UniFi only while the Debian mongodb package comes with a default config and the init script that will launch a mongod.
    On Debian and Ubuntu installing a service will automatically enable its execution on system start or after installation of MongoDB.

    The thing I realized, was that you can stop the package-installed mongod and see UniFi continue to running. It's actually UniFi who controls and starts its own MongoDB server process and (in case of the Debian package) points DB and Journ to /var/lib/unifi).
    This means that you end up with 2 mongod processes runningg if you don't pay attention depending on your system default assumptions.

    For pfSense the FreeBSD mongodb port and its according package also ship a BSD rc script, but if you didn't add it to /etc/rc.conf(.local) mongodb rc script won't be executed during boot.
    Similarly RHEL and Fedora distributions require you to explicitely enable daemons via chkconfig. (on Debian you'd use update-rc.d with parameters to disable things)

    Having 2 mongod's running wouldn't be much of a problem, BUT: MongoDB has a preallocation mechanism which generates prealloc.X files by default.
    They are reserved space for mongod in case it quickly needs to allocate more space - which for web applications may be better instead of waiting for the FS to allocate the space. On Debian these default prealloc files take up to 3.1GB - now with 2 mongod's running, one via system ini script, one via UniFi, you end up with 2x 3.1GB of pre-allocated space. If you delete the prealloc files you'll see them recreated at every restart of mongod. (See: mongodb - Monogo "prealloc" files taking up room - Stack Overflow)

    Lesson learned and thank you for your hints :-)

SHARE:
+ Post New Thread

Similar Threads

  1. How big is yours?
    By Hightower in forum Windows Server 2008 R2
    Replies: 11
    Last Post: 9th August 2011, 02:25 PM
  2. [WDS] How big is your boot image?
    By Tricky_Dicky in forum O/S Deployment
    Replies: 18
    Last Post: 27th July 2011, 11:48 AM
  3. How big is your printing budget?
    By JJonas in forum Budgets and Expenditure
    Replies: 16
    Last Post: 8th January 2009, 01:33 PM
  4. How big is your backup?
    By DavidB4910 in forum Wireless Networks
    Replies: 16
    Last Post: 25th May 2007, 09:14 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •