Best practice: profile before adding memcached?

Steven Grimm sgrimm at
Sun Feb 4 19:22:21 UTC 2007

It is best practice to profile before doing *any* performance 
optimization, memcached-related or otherwise. In the case of memcached, 
depending on how far you take it, profiling can tell you which objects 
are most frequently constructed from raw data, how frequently they 
change, which queries are actually costing you the most time, etc. With 
that information in hand you can cache the stuff that'll give you the 
biggest bang for your buck. Without that information you will likely 
make your code faster, yes, but you will likely waste your time writing 
caching code for stuff that isn't actually performance-critical in your 

I can't remember one time when I did detailed profiling and wasn't at 
least a little surprised by the results. If you are having performance 
problems it's almost always worthwhile.


Jason Edgecombe wrote:
> Hi,
> I have  a question about best practice. Should the code and database 
> queries be profiled before adding memcached to the mix? How throughly 
> should it be profiled?
> Jason

More information about the memcached mailing list