tags:

views:

209

answers:

2

I was curious... are there any pro/cons of using compression in memcache?

+3  A: 

Many clients do compression, but no compression happens in the server itself.

Client-side compression means less data is sent over the network, but more importantly, individual objects are smaller. Smaller objects will likely be stored more efficiently as they are more likely to fall into smaller slabs.

Even if you don't see significant reduction in slab overhead waste, you should likely have more space available for more objects.

Dustin
What about downsides? CPU?
Yegor
There will be a bit of CPU overhead. If you can measure it, you can adjust your compression algorithm accordingly. :)
Dustin
A: 

I wasn't aware of compression options in Memcache clients.

However, I think that if you need more space on the Memcache server, you should invest in more ram or possibly more servers if need be. Compressing data will cost CPU cycles on your webserver (depending on the algorithm and degree of compression), and basically I don't think it's worth it.

BTW, Ram is cheap :)

Sune Rievers