[Graphite] whisper-resize.py : the easy way to change storage schemas retentions on carbon-cache


The default data retention policy in carbon-cache is 1 day, as we can see in the file /etc/carbon/storage-schemas.conf:

pattern = .*
retentions = 60s:1d

For my monitoring needs, I usually change the retentions setting to:

pattern = .*
retentions = 10s:6h,1min:7d,10min:1800d

On ubuntu 14.04, restarting carbon cache don’t change the retentions fast enough.

How change the retentions on carbon cache (the easy and fast way)

Download whisper from github:

wget --no-check-certificate https://github.com/graphite-project/whisper/archive/master.zip
unzip master.zip
cd whisper-master/bin

and then:

find /var/lib/graphite/whisper/Symmetrix/ -iname "*.wsp" | xargs -n 1 -I% sudo -u _graphite whisper-resize % 60s:7d 5m:60d 10m:1y 30m:5y

Now you check whatever directory inside /var/lib/graphite/whisper/Symmetrix/ and you can see:

ll -lrth /var/lib/graphite/whisper/Symmetrix/821/Director/FA-7H/Port/1/

total 7,0M

drwxr-xr-x 3 _graphite _graphite 4,0K oct 13 10:28 ../
-rw-r--r-- 1 _graphite _graphite 17K oct 16 11:46 IOPs.wsp.bak
-rw-r--r-- 1 _graphite _graphite 17K oct 16 11:49 KBsec.wsp.bak
drwxr-xr-x 2 _graphite _graphite 4,0K oct 16 11:50 ./
-rw-r--r-- 1 _graphite _graphite 2,0M oct 16 12:02 KBsec.wsp
-rw-r--r-- 1 _graphite _graphite 2,0M oct 16 12:02 IOPs.wsp


Leave a Reply

Your email address will not be published. Required fields are marked *