Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
quick examples of how to change many many wsp (graphite/whisper) files settings
for f in $(find $1 -iname "*.wsp"); do
if [ -a $f ];
then /opt/graphite/bin/whisper-set-aggregation-method.py $f max;
fi;
done
for f in $(find $1 -iname "*.wsp"); do
if [ -a $f ];
then /opt/graphite/bin/whisper-resize.py $f 10s:12h 60s:7d 10m:3y;
fi;
done
@amorphic

This comment has been minimized.

Copy link

@amorphic amorphic commented Aug 1, 2013

Here's a one-liner to resize all whisper files below a given directory:

find ./ -type f -name '*.wsp' -exec whisper-resize.py --nobackup {} 1s:2d 10s:31d 60s:365d \;
@labeneator

This comment has been minimized.

Copy link

@labeneator labeneator commented Jul 2, 2014

And a quick one liner for debian.

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

This comment has been minimized.

Copy link

@gargnisha1605 gargnisha1605 commented Jan 30, 2017

Hi I used the following command to change the retention policies of my existing metrics:
find ./ -type f -name '*.wsp' -exec whisper-resize {} 10s:6h ;

Before changing the retention policies:
find ./ -type f -name 'count.wsp' -exec whisper-info {} ;
maxRetention: 86400
xFilesFactor: 0.5
aggregationMethod: average
fileSize: 17308

Archive 0
retention: 86400
secondsPerPoint: 60
points: 1440
size: 17280
offset: 28

After changing the retention policy from 60s:1d to 10s:6h, my file size has increased.
find ./ -type f -name 'count.wsp' -exec whisper-info {} ;
maxRetention: 21600
xFilesFactor: 0.5
aggregationMethod: average
fileSize: 25948

Archive 0
retention: 21600
secondsPerPoint: 10
points: 2160
size: 25920
offset: 28

I have changed the retention policy to clear some space from graphite server, but wsp file size has increased after whisper-resize. Can any body guide my how to clean whisper data.

@7yl4r

This comment has been minimized.

Copy link

@7yl4r 7yl4r commented Jun 29, 2017

@gargnisha1605 : you have increased the number of data points to retain with this operation because of your higher sampling frequency.

60s:1d is one day's (24h) worth of minutes (24h * 60m/h * 60s/m) / 60s = 1440.

10s:6h is six hours of decaseconds (6h * 60m/h * 60s/m) / 10s = 2160

The resize filled in the gaps your new policy created (probably with 0s).

@DevJackSmith

This comment has been minimized.

Copy link

@DevJackSmith DevJackSmith commented Sep 28, 2017

@gargnisha1605 and anyone else doing this for storage space, you can check your retention size per metric here: https://m30m.github.io/whisper-calculator/
Don't forget that every counter has 2 metrics (count and rate), and every timer has about 10 or so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment