Are you using Cache::Memcached and its ->stats method?

It's very slow if you have more than a few thousand keys in memcached. Not an unusual use case I think? I've got a fix here, which appears to DTRT: https://rt.cpan.org/Ticket/Display.html?id=138133. Maybe? I didn't spend too long looking at memcached's low level wire protocol.

The patch passes all the module's current tests and works for us. It took our CPU load from being pegged at 75% all of the time to being idle. So, if you're using Cache::Memcached, and the ->stats method (which isn't in the XS version of the module) then you might want this patch.

On that note - who is maintaining Cache::Memcached? The last release was in 2012. This isn't a high river module, but any app of significant size or age is *probably* using it and if they're using the ->stats method then ... Sure there's the ::Fast version, but I suspect this version is in a lot of places.

So if you know someone who knows someone who can prod the current maintainers then please point them at this post/patch. If you're using Cache::Memcached then perhaps try out this patch as well.

4 Comments

It's not even on GitHub! And the issues looks pretty unattended.

Have you tried Cache::Memcached::Fast? That at least looks like it's been touched recently.

Have you considered contributing your modified, faster stats() method to Cache::Memcached::Fast so that you can stop using Cache::Memcached entirely? Or does it rely on too much plumbing from other parts of Cache::Memcached to make that feasible?

Leave a comment

About Lee J

user-pic I blog about Perl.