Limit for RRD files

I do not need to keep the data more then 6 months. How i can set the limit for the RRD files.

You will require to append [rrd_rra] settings in config.phpm but it is up to you to do the math. I personally suck at math so given examples below may be incorrect and broken, but it shall give you the main idea.

The default settings are:

$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 ';

With a polling interval of 5 minutes this translates to:

RRA:AVERAGE:0.5:300s average:2016		604800s = 10080m = 168h = 7d
RRA:AVERAGE:0.5:1800s average:1440		2592000s = 43200m = 720h = 30d
RRA:AVERAGE:0.5:7200s average:1440		10368000s = 172800m = 2880h = 120d
RRA:AVERAGE:0.5:86400s average:1440		124416000s = 2073600m = 34560h = 1440d ~ 4y

RRA:MIN:0.5:300s average:720			216000s = 3600m = 60h = 2.5d
RRA:MIN:0.5:1800s average:1440			2592000s = 43200m = 720h = 30d
RRA:MIN:0.5:7200s average:775			5580000s = 93000m = 1550h = 64.5d
RRA:MIN:0.5:86400s average:797			68860800s = 1147680m = 19128h = 797d ~ 2y

RRA:MAX:0.5:300s average:720			216000s = 3600m = 60h = 2.5d
RRA:MAX:0.5:1800s average:1440			2592000s = 43200m = 720h = 30d
RRA:MAX:0.5:7200s average:775			5580000s = 93000m = 1550h = 64.5d
RRA:MAX:0.5:86400s average:797			68860800s = 1147680m = 19128h = 797d ~ 2y

RRA:LAST:0.5:300s average:1440			432000s = 7200m = 120h = 5d

The main problem here is that rrdcached is not that easy to understand even after a day of study. In the end, due to lack of good examples, I set the following settings in an attempt to keep data for 1 year

$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:365';
$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:365';
$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:365';
$config['rrd_rra'] .= ' RRA:LAST:0.5:1:1440 ';

Mind that existing RRD files you have are already created with the settings by default. In order to change them, you will need to use rrdresize tool to resize existing blocks. If you will make any changes to config without this, new [rrd_rra] settings will be only applied to new devices added to LibreNMS.

Here are few articles I personally found useful on the topic:
http://cuddletech.com/articles/rrd/ar01s02.html
https://apfelboymchen.net/gnu/rrd/create/

FYI, RRD files are fixed size so they will never increase in size. Data is discarded over time with the default RRA, so the RRD size is very reasonable.

Thanks to angryp and murrant.
However we want to keep the graphs only for 6 months, no longer then that. How can we set the LibreNMS to have the data only for 6 months.

No idea.
I suggest you read the rrdtool docs. https://oss.oetiker.ch/rrdtool/doc/rrdcreate.en.html

There is an online calculator
https://eccentric.one/misc/rrdcalc.html