django-fancy-cache with or without stats

If you use django-fancy-cache you can either run with stats or without. With stats, you can get a number of how many times a cache key “hits” and how many times it “misses”. Keeping stats incurs a small performance slowdown. But how much?

I created a simple page that either keeps stats or ignores it. I ran the benchmark over Nginx and Gunicorn with 4 workers. The cache server is a memcached running on the same host (my OSX 10.7 laptop).

With stats:

Average: 768.6 requests/secondMedian: 773.5 requests/secondStandard deviation: 14.0

Without stats:

Average: 808.4 requests/secondMedian: 816.4 requests/secondStandard deviation: 30.0

That means, roughly that running with stats incurs a 6% slower performance.

The stats is completely useless to your users. The stats tool is purely for your own curiousity and something you can switch on and off easily.

Note: This benchmark assumes that the memcached server is running on the same host as the Nginx and the Gunicorn server. If there was more network in between, obviously all the .incr() commands would cause more performance slowdown.

django-fancy-cache with or without stats

相关文章:

你感兴趣的文章:

标签云: