Best practice: profile before adding memcached?

Jed Reynolds lists at benrey.is-a-geek.net
Fri Feb 9 01:00:00 UTC 2007


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
>
>

 From a safety point of view, I'd assume that you should profile things 
to be as efficient as reasonably possible so your system doesn't fall 
over durning the loss of caching. For example, if an unexpected series 
of reboots takes out your memcached resources, you prolly still want 
your site to at least...stay up, until you can repopulate your cache. It 
might be very very difficult to repopulate your cache if your machines 
are so bogged down that you can't run all the queries and do a 
batch-populate.

Also, if you're periodically batch-populating your cache (refreshing it 
with a cronjob), you still want those sql queries to be kind to your 
database, too. You don't want to get so sloppy that your system is 
affected by the effort of scheduled cache refreshing.

Best to capacity plan to be able to handle the situation where your 
caching is empty and you're live and you're running a cache refresh at 
the same time.

Jed


More information about the memcached mailing list