Memcached Compression Problem

Maxim Dounin mdounin at
Thu Oct 11 16:09:01 UTC 2007


On Thu, 11 Oct 2007, Shaun McQuaker wrote:

> I'm having a particularly weird memcached problem. I am using memecached 
> 1.2.1 across 5 servers and the Perl client API version 1.24. For the sake of 
> simplicity in describing my problem I'm going to break my servers into two 
> groups, the first called group A with 3 servers, and the second group B with 
> 2 servers. My problem goes something link this; a server in group A adds a 
> value into its own cache (so the server parameter is localhost:9999) with a 
> perl call like this: $memd->set($key, $value, 60*60*24*30). Then a server 
> from group B attempts to read this value using $memd->get($key) from the 
> server in group A. The  problem is that output is completely garbled and 
> looks like it's compressed. The value should indeed be compressed as it is 
> larger than the compression threshold that I have set. So it looks to me like 
> the client on the server in group B could not uncompress the value. One 
> further note, the server in group A can read and display the value correctly.
> So now my questions:
> 1. is the value compressed by the memcached server or the client API?

Compression implemented entirely in client API code (if any).

> 2. what package (lib) is used for compression?

In perl it uses Compress::Zlib library.

> 3. anyone know how to fix this? or where to start? :)

Make sure you have Compress::Zlib installed on your servers.

Maxim Dounin

More information about the memcached mailing list