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 ...
7th January 2013, 11:57 AM #1
- Rep Power
Ubiquiti UniFi: How big is your DB - does it keep growing?
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'?
IDG Tech News
7th January 2013, 12:07 PM #2
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.
7th January 2013, 12:22 PM #3
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.
7th January 2013, 12:55 PM #4
- Rep Power
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.
7th January 2013, 01:51 PM #5
You got me worry I have just install my controller on a pfsense system.
7th January 2013, 02:49 PM #6
- Rep Power
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 :-)
By Hightower in forum Windows Server 2008 R2
Last Post: 9th August 2011, 02:25 PM
By Tricky_Dicky in forum O/S Deployment
Last Post: 27th July 2011, 11:48 AM
By JJonas in forum Budgets and Expenditure
Last Post: 8th January 2009, 01:33 PM
By DavidB4910 in forum Wireless Networks
Last Post: 25th May 2007, 09:14 AM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread