Archive for November, 2010

Memcached vs. mysql query cache

And the winner is (in this case): memcached
On my site there is a course scheduler, and today i switched one simple query to fill memcached every 5 minutes.

Before this special site took around 0.09 seconds to load,
With memcached it takes 0.047 seconds. Thats almost half the time.
When filling memcached its 0.13 seconds, so is a bit slower, but most time this little change improves the site.
The query that now gets it boost from memcached is just a query that gets date and time for a specific course, so it would run around 100 times on that page.

As i use the query cache from mysql for both queries i can say, that even if memcached is running on the same machine, memcached won for this case.
In other cases the query cache may win.


, ,

Leave a comment

%d bloggers like this: