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.


, ,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: