Munin, like every tool of its type that I'm aware of, uses round robin database, or RRD, files to store its data. Here is an explanation of the basics of RRD. An RRD file is made up of Round Robin Archives, or RRAs. An RRA is "lossy" in two senses of the word, it combines multiple data points into one and it overwrites data after a certain amount is collected. You get to specify how this is done. For example, lets say I created an RRD file with the command
rrdtool create example.rrd \
[skip some necessary options]
The step of 300 says we are collecting metrics, which rrdtool refers to as primary data points or PDPs, every 5 minutes. Each RRA line specifies four things, CF:xff:steps:rows.
1) The CF, or consolidation function. This determines how RRD combines multipe primary data points into consolidated data points, or CDPs. It can AVERAGE all the values, use the MIN imum value, use the MAX imum value, or just use the LAST value.
2) The "x files factor", is what ratio of the data must be missing before the CF will return a value of UNKNOWN rather that operating on the non-missing data.
3) The steps, which is how many primary data points are used to calculate the consolidated data point.
4) The rows, which is how many consolidated data points to keep.
In our example, the first RRA would keep your primary data points for one day, the second would average your primary data points every hour and keep the daily averages for one week, and the third would average your primary data points every day and keep the daily averages for four weeks.
If you want Munin to retain longer and more detailed data, use RRD files that have RRAs with lower steps and higher rows. This is controlled by the graph_data_size option. Munin has a human-readable syntax to make this easy to configure. The options in our earlier example would translate to
graph_data_size custom 5m for 1d, 1h for 1w, 1d for 4w
If you want to keep your primary data points for two years, you can take a shortcut and set graph_data_size to huge.
After changing this option, you have to delete your existing RRD files so Munin will create new ones with your new retention settings