memcached - Django cache performance -


We are now using Redis for in-memory cache for our Django application (we used the first memcatch The difference in performance is no big, and we're using Redis because the disc dump feature).

The problem is that Django cache's performance in my view - terrible, we have a view with 102 cache hits (no miss), and it has 81 ms (only the cash part, which is with the DJBugBug toolbar Is measured). In my opinion - this is a very long time, I know, asking for a question for DB can be 10x more (or 100x) time, but that is also not good with cash performance of that fact.

We are running radis (and the first memacatch) on different hosts, connected to the local network with other servers.

Is there a way to maximize cache performance in Django?

Instead of displaying problem cache, there is a possibility of the number of items to be received for each page 102 Cash calls mean long time lost due to network latency. With full control of the code, you may be able to fix it with multithreading or pipelining, but in this case you do not have that option - using a framework is to obtain very simple code at the cost of low performance on the edge of the issue < / P>

The easiest way to move the redis cache on the web server - a local request is too fast, it is invalidating the cache, but you might be able to replicate it. Alternatively you can write all the master nodes and read from the local slaves so that all the nodes are cached, or used locally to repeat the scripts with the master node when you invalidate the object If you want all the slaves command dell.

One more thing is that performance is actually a problem. 300 mms is not very bad to load the page in case of experience for a user. This is only a problem if it means that you can not handle more than 3 pages per second in all users - in this case there is no possibility That is the interruption network latency instead of CPU or local I / O.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -