Is compression recommended?

Steven Grimm sgrimm at
Tue Jan 30 19:00:47 UTC 2007

Compression happens entirely on the client side. That's a plus and a 
minus. It's a plus because it doesn't affect CPU scaling of the 
memcached server (it even improves it slightly since there's less data 
to shuffle around). It's a minus because it will cause your clients to 
eat more CPU time, possibly a LOT more if they are compressing and 
uncompressing a large number of cached objects per request. At some 
memcached installations -- ours, for example -- client CPU time is a 
more expensive resource than memcached memory, so it's not worth the 
tradeoff for us. Your situation may be different.

As far as memcached is concerned, a compressed object is just like an 
uncompressed one: a blob of bytes whose meaning it knows nothing about. 
As long as the client handles compressing and uncompressing properly 
(and I assume most or all of the standard clients do) there shouldn't be 
a problem.


howard chen wrote:
> Hi,
> I want to use memcached to store the output of dynamic pages, but the
> total number of pages to be cached might be quite large, so I want to
> use compressor provided by memcached.
> Is it recommended to use compression? Anything I need to take care of?
> Thanks.

More information about the memcached mailing list