Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Perl, Memcached and SASL

by moritz (Cardinal)
on Jun 19, 2013 at 20:03 UTC ( #1039838=perlquestion: print w/replies, xml ) Need Help??

moritz has asked for the wisdom of the Perl Monks concerning the following question:

I need to talk to a memcached server in Perl program, and I need to uses SASL.

Now Perl has a whole bunch of memcached client libraries, but seems that none supports SASL.

The closest seems to be Memcached::libmemcached, which is a very thin wrapper around the C libmemcached library. In theory, all I need to do is to expose the memcached_set_sasl_auth_data function, call it once, and be happy. In practice, this segfaults (I've tried this in the sasl branch of this repository). It seems that the libmemcached library bundled with the perl module is very out of date, and upgrading to a new one is no easy task, because much of structure of the header files changed.

My next hope was that it could be relatively easy to pair up Authen::SASL and one of the existing memcached clients. However Memcached only supports SASL for the binary protocol, and all the other perl modules only support the text protocol (please correct me if I'm wrong here).

Finally there's a small pure-perl client in the tests of the memcached server, which seems to be my only remaining option. I'm reluctant to use it though, because it's not maintained as a "real" client, has no docs and no proper error handling.

So, my question is: Are there any options I overlooked? Or is somebody maybe even working on a client with sasl support? (Or is there another comparable open-source distributed memory cache with perl libraries that support authentication?).

Replies are listed 'Best First'.
Re: Perl, Memcached and SASL
by Loops (Curate) on Jun 20, 2013 at 01:24 UTC

    This one supports the binary protocol:


    But no native SASL support. If you manage to wire something up it'd be great to hear about your success.

Re: Perl, Memcached and SASL
by strredwolf (Chaplain) on Jun 19, 2013 at 23:02 UTC

    Is this Memcache on a remote server or on the server you will have your Perl on?

    Information doesn't want to be free. It wants to be feline.

      Yes. I will have it installed on same four machines that the application runs on, and I have some freedom of how the stuff is set up, exactly. But since people can ssh to those machines, authentication is mandatory.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1039838]
Approved by jfroebe
Front-paged by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2020-05-25 17:34 GMT
Find Nodes?
    Voting Booth?
    If programming languages were movie genres, Perl would be:

    Results (146 votes). Check out past polls.