I’m Backkkk … again!!!
So here, we’ll talk about graphite woo!
If you don’t know what is graphite, have a look at: http://graphite.wikidot.com/
Data retention can be configured in Graphite.
The way graphite does it, is by using a pair: TimePerPoint:timeToStore.
TimePerPoint refers to the interval between each stored datapoint (it’s then also a precision metric – average over the period specified).
TimeToStore refers to the number of datapoints we would keep.
The retention configuration is done through /opt/graphite/conf/storage-schemas.conf.
You can specified different retention settings for the same data by separating them with commas.
This translates to: for any metrics under mysql, keep 43200 datapoints at 1-minute precision, and 350400 datapoints at 5-minutes precision which is:
- 43200 / 60 / 24 ==> keep 1-minute precision datapoints for 30 days
- 350400 / 12 / 24 / 365 ==> keep 5-minutes precision datapoints for 3 years
Also, be aware that retention are set in the file when first metrics is received.
This means that if you decide to change retention on a metric that you already have data for, you would have to either:
Delete the metric file, and leave graphite recreating it
Resize the file with the whisper command
For example, here’s a file that doesn’t have the retention we would want to, which would be 1-minute precision for 30 days:
To change retention use:
Also … what if you did resize but you can’t see any more disk space in return … well the resize command move the old data into a new file: .bak
You can either delete the bak file or use the command flag: –nobackup
I hope this will help you manage your graphite data better!