Graph resolution

Asked by Antony Bobrov

Hello. How to draw graphs with one second resolution? I created following schemas for example client:

[server_load]
priority = 100
pattern = ^system\.
retentions = 1:300,60:120 # second resolution timepoints for 5 minutes and minute resolution points for 2 hours

And removed all *.wsp files. After restarted carbon daemon.

But graphs in webapp remains in 1 minute resolution.

I want to use graphite to monitor java web apps and high resolution is critical factor.

Question information

Language:
English Edit question
Status:
Solved
For:
Graphite Edit question
Assignee:
No assignee Edit question
Solved by:
chrismd
Solved:
Last query:
Last reply:
Revision history for this message
Antony Bobrov (bobrov) said :
#1

I have changed my schemas:

[server_load]
priority = 100
pattern = ^system\.
retentions = 2:300,60:120

2 second resolution timepoints.

And graph is drawing with 2 second resolution.

graphite version is 0.9.2

Revision history for this message
chrismd (chrismd) said :
#2

That is strange that two second resolution worked for you but not one second. I just tested it and one second resolution worked fine for me. It is probably that carbon created the files with a different schema before your restart. But to confirm that there is no bug, please try it again by first stopping carbon, updating the schemas file to have one second precision, start carbon, start sending your data, then verify the file was created appropriately like so:

>>>from graphite import whisper
>>>whisper.info("storage/whisper/system/loadavg_1min.wsp")
{'maxRetention' : 7200, 'lastUpdate' : 1215381198, 'xFilesFactor' : 0.5, 'archives' : [{'retention' : 300, 'secondsPerPoint' : 1, 'points' : 300, 'size' : 3600, 'offset' : 40}, {'retention' : 7200, 'secondsPerPoint' : 60, 'points' : 120, 'size' : 1440, 'offset' : 3640}]}

Your output should be similar, the key thing to look for is a dict within the archives list that has a secondsPerPoint value of 1. If you see this and you are sending your data once per second then your graph should have one second precision.

One important caveat to note about using sub-minute precision. Since a majority of use cases for graphite use one minute precision, the graphite webapp makes this assumption when caching data and graphs. That is, you should probably turn off caching if you plan on using a higher precision than one minute. To turn off caching see https://answers.launchpad.net/graphite/+question/37808

Revision history for this message
Antony Bobrov (bobrov) said :
#3

>>> whisper.info("/usr/local/graphite/storage/whisper/system/loadavg_1min.wsp")
{'maxRetention': 6000, 'lastUpdate': 1215396662, 'xFilesFactor': 0.5, 'archives': [{'retention': 300, 'secondsPerPoint': 1, 'points': 300, 'size': 3600, 'offset': 40}, {'retention': 6000, 'secondsPerPoint': 60, 'points': 100, 'size': 1200, 'offset': 3640}]}

So, it's ok with whisper storage.

But i have two interesting graphs:

http://baverman.info/media/render_last_4min.png
http://baverman.info/media/render_last_5min.png

Then I request data for last 4 minutes. Graph has 1 second precision. More -- only 1 minute!

I have no memcache module. And turn off cache during webapp configuration.

Revision history for this message
Best chrismd (chrismd) said :
#4

So here is what is happening. Your database is configured to have two archives, the first stores 5 minutes of one-second precision data, the second stores 100 minutes of one-minute precision data. The way whisper works when you request data is to look for the highest precision archive that covers the entire requested interval, which in your graph was the past 5 minutes. So your one-second precision archive should just barely cover it and hence your graph should have one-second precision, but upon looking a little closer I can see why this does not happen. Basically whisper was using a > comparison rather than a >= comparison when checking to see if each archive covered the interval, thus an archive would have to cover at least one second more than the requested interval in order to match, which is why only your lower precision (minutely) archive matched and hence your graph has one minute precision. I have committed a fix to trunk to compare with >= which should make this case behave properly.

Revision history for this message
Antony Bobrov (bobrov) said :
#5

I appreciate your help. Thanks a lot!

Revision history for this message
Antony Bobrov (bobrov) said :
#6

Thanks chrismd, that solved my question.