What determines the webapp graph caching?

Asked by Andrew Petersen

I'm trying to get as close to real-time as possible, and while I don't plan on refreshing the graphs every second, it would be nice to be able to do 5 or 10 second intervals between and see the graph change.

I've set my retention as follows:
1s:2h,10s:6h,60s:7d,10m:3y

I'm using StatsD, and have set my flush interval to 1000ms.

When I view a raw graph using the url api, the graph is static for about 30 seconds.

 Is there a setting I'm missing that lowers the update interval?

I also found this blog post: http://blog.stuartherbert.com/php/2011/09/21/real-time-graphing-with-graphite/, which talks about setting MEMCACHE_DURATION = 1 in local_settings.py, but memcache_duration is not there, so I can't tell if that would do nothing, or was used in a old version of the webapp. I am using memcache, but the only setting I see in the local_settings.py that is relevant is MEMCACHE_HOSTS.

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
Best chrismd (chrismd) said :
#1

You can customize the caching behavior per-request by specifying the cacheTimeout query-string parameter. It is the number of seconds graphs will be cached for, it defaults to DEFAULT_CACHE_DURATION, which defaults to 60 seconds. Just set DEFAULT_CACHE_DURATION to whatever you want the default to be in your local_settings.py and you should be good to go.

Revision history for this message
Andrew Petersen (kirbysayshi) said :
#2

Ah, that did it. Thanks! Are these variables documented anywhere? That variable definitely was not defined in my local_settings.py.

Revision history for this message
Andrew Petersen (kirbysayshi) said :
#3

Thanks chrismd, that solved my question.

Revision history for this message
Andrew Petersen (kirbysayshi) said :
#4

Huh. Apparently clicking the "that solved my problem" auto posts. Didn't mean to do that, just meant to mark your response as an answer.