jump to navigation

controlling memcached with Phusion’s daemon_controller September 6, 2008

Posted by John Dewey in Code, Deployment, Memcached, Plugins & Gems, Rails, Ruby.
add a comment

I am working on an application that utilizes memcached, and want to develop against a locally running instance. Previously, we pointed our development environment to a sandboxed memcached cluster, which can be slow depending on time of day, location, and network. I typically mock external resources, however, I like a living memcache.

This post describes a way to start memcached automatically with script/server, and is a continuation of the daemon_controller memcached configuration post.

As the Phusion guys pointed out. Pulling code — and not worrying about configuration is AWESOME! This is especially true in the development environment.


Adding this to development.rb will automatically start and stop memcached via ‘script/console’ and ‘script/server’. SAs maintain the daemons in the other environments via SMF, nor am I interested in maintaining those environments (did that … done that).

daemon_controller memcached configuration September 4, 2008

Posted by John Dewey in Configuration, Deployment, Memcached, Plugins & Gems, Rails, Ruby.

The Phusion guys created a sweeet library (daemon_controller) to control servers or daemons. I created a daemon_memcache class which controls memcached.

Memcached can be controlled programatically by:


Will show you how to utilize this class to start/stop Memcached via ‘script/server’ in a follow-up post.

multi-port memcache init script August 16, 2008

Posted by John Dewey in Code, Configuration, Memcached.
add a comment

We use memcached quite a bit, and deploy it as a farm of many processes across many systems. I wanted to share a memcached multi-port init script. See the README for usage. Script is based off “The Commando Pattern“, and could use some reworking (especially around the port definition area).

memcache ruby 1.8.5 problems August 14, 2008

Posted by John Dewey in Memcached, Rails, Rake, Ruby, Solaris.
1 comment so far

We have some boxes at Joyent and for one reason or another, they are still on 1.8.5. We memcached an expensive Solr query, but ran into intermittent 500 errors.

Look at the odd stacktrace, with references to rake. Anyways, long story short – an upgrade to 1.8.6 fixed the problem. Yeah Yeah Yeah, I know — bad us — we should have upgraded long ago.

ActionView::TemplateError (wrong number of arguments (1 for 2))
on line #15 of topics/_search_result.html.erb:

View the pastie