Sql Database size

I am trying to figure out the hardware needed to deploy LibreNMS across our entire network. I did some rough calculations and figured about 207,000 ports/health moniters across ~6000 devices. I figure I need a separate server for LibreNMS and the web GUI, 4 pollers and a separate database server. I have been wanting to offload our databases to a dedicated server for a while now. but I am trying to figure out how much storage space I need for the databases. My boss wants at least 5 years of historical data stored. How much drive space would be needed by LibreNMS?

We have a lot of purging going on in the DB - do you really want to keep that info for 5 years?

Our install of circa 4k devices is using this (no syslog)

du -sh /var/lib/mysql/librenms/
21G	/var/lib/mysql/librenms/

So the question is, what data do you want to store for 5 years as we don’t do that by default.

I’m curious as to what the default is now. The idea is to have all data accessible for historical trends. I actually had to talk him down to 5 years as he wanted all data ever, just throw more drives at it he says :). would it be impossible to offload the older data to a separate archival server (using cheaper drives) after a couple years?

I was hoping for some sort of formula, like bytes/datapoint/day or something like that. I was able to do that with Zabbix when we were looking at that, do you know if the systems are similar enough for those numbers to work?

So you want to store graphs for that long?

You will need to adjust:

$config['rrd_rra']  = ' RRA:AVERAGE:0.5:1:2016 RRA:AVERAGE:0.5:6:1440 RRA:AVERAGE:0.5:24:1440 RRA:AVERAGE:0.5:288:1440 ';
$config['rrd_rra'] .= ' RRA:MIN:0.5:1:720 RRA:MIN:0.5:6:1440     RRA:MIN:0.5:24:775     RRA:MIN:0.5:288:797 ';
$config['rrd_rra'] .= ' RRA:MAX:0.5:1:720 RRA:MAX:0.5:6:1440     RRA:MAX:0.5:24:775     RRA:MAX:0.5:288:797 ';
$config['rrd_rra'] .= ' RRA:LAST:0.5:1:1440 ';

This defines how long we store stuff for. It’s documented in rrdtool documentation.

thank you, but back to the original question, is there a way to calculate how much storage space is needed? I imagine it’s more based on data points (ports/monitors) then device count?

You’d have to create an rrd file with the values you want to get you 5 years and then multiply that by how many rrd files you expect. Create a port rrd as they are typically the biggest ones so that will error on the side of caution for you.

I just used a generic rdd file calculator, to do what he wants will require an 8tb database, and since I want to keep the database on RAM… that’s not going to happen in our budget. Thank you, when you mentioned the 4k devices using 21gb, how many ports is that? or how many rrd files?

Graphs aren’t stored in the database, they are stored on disk. You can’t keep those in memory.

You need to be careful about your wording here @Sam_Ashcraft. RRD files aren’t stored in the database. The 21GB for me was purely mysql as I thought that was what you wanted at the start. For RRD we are storing 200GB of data at present.

You can store RRD in ram (ramdisk) but unless it’s a small install it’s unlikely you will have the memory in a single box to do that.

thank you for the clarification, that makes a lot more sense. However, that just brings me back to the original issue, figuring out the port size of the database entry. The hardware requirements can be calculated from there. If you look at the Zabbix documentation here is gives you a simple formula to figure out database requirements based on a number of datapoints, time interval, how long to keep it, and most importantly the size of each database entry (usually about 100 bytes). I just need that last variable. When something comes in from the poller and is saved to the database how big is it? From there it’s simple multiplication.

Unless LibreNMS is using some sort of data storage wizardry, I don’t see how device count has much impact on the database. A 4000 device network where each device has 10 values being checked is going to require a much smaller database than that same network but with 100 values per device. What is important is the size of each value.

You’re confusing things again, forget what Zabbix says, we aren’t Zabbix. We store metrics for the most part in rrd files which is what you are wanting to store for 5 years but you’ve yet to confirm that. Please stop referencing databases.

A port rrd file is 1.8M.
A sensor rrd file is 123K

You can calculate how much space that will take I hope. Keep in mind that this is for 2 years, I don’t know what the file sizes are for 5 years of retention. I suggest you take a look at rrdtool itself and how it works so you can calculate further.

If you’re not storing the metrics in the database what is stored in there? and what are the variables that effect it size? I am referencing databases because that’s what I am asking about. Storage is simple to figure out, but I need the DATABASE requirements of LibreNMS. I can’t just order random hardware and hope it’s enough.

The database stores things like eventlogs / alerts / alert logs and then mostly data we use to work out what to poll, it’s not data you can make use of for any historical trends / analysis.

It doesn’t contain metrics.

ok then, what are the variables that affect the size needed? how big do the event logs get etc? That’s the information I need.

That all depends on how many events you generate from changes in your network.

Your asking something for which we have no data for and no calculation available to work it out.

Someone might be willing to show you the size of the tables and row count of there database so you can see what real life is like.

That’s the data I was hoping for :(. I guess I can just your 21GB for 4000 and figure about 6mb per device (I’ll multiply that by some factor of course). How far back do the logs in the database go back for? I assume that events and alerts will just keep growing.

These are the default purge values in days: http://docs.librenms.org/Support/Configuration/#cleanup-options

I’m fairly certain we’ve adjusted ours down for eventlog to something like 7 or 14 days.

Ok thank you, I think I can work with this. That equates to about 750k per device per day. Thank you again