Testing memcache vs db

David B davidb999 at gmail.com
Fri Jun 24 14:36:07 PDT 2005

Curious if any of you have some metrics of using memcache with a
db…performance numbers before and after?
If not what would be a good way of testing?

I can imagine a simplistic loop that runs the same query a million
times but the db would cache it itself after the first select * from
customer where customerid = 1
And so the db will be faster on subsequent queries.

By the same token if I query where customerid = N and loop through n
from 1-1million I will not find hits in db or in cache.

As a quick test I wrote a program that queried where cust = 1 for
1million passes.
Memcache was 4times faster... I was expecting more like 50-100x...but
I suspect it was because of the db caching result (all running on same

Thank you for any ideas or suggestions or pointers to existing results…

More information about the memcached mailing list