Search code examples
rubyherokumemcachedeventmachinegoliath

eventmachine memcache and heroku


I'm trying to use the eventmachine built in memcache client (with em-synchrony) in my goliath powered web app. It runs beautifully locally, but when I deploy to Heroku, I can't get it to connect. Here's what I'm using to open the connection:

cache = EM::P::Memcache.connect

Is there a way I can get it to work, or am I going to have to use a different client, like Dalli? Are there any other eventmachine based memcache clients? Cheers for any help


Solution

  • I figured out that the EventMachine memcache client doesn't support SASL authentication, which heroku (and some other hosted memcache servers) require. I was initially avoiding the Dalli gem because I thought it lacked async support, but you just have to set async => true when instantiating the client and it works great