jump to navigation

daemon_controller memcached configuration September 4, 2008

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

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:

DaemonMemcache.instance.start
DaemonMemcache.instance.running?
DaemonMemcache.instance.stop

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

Advertisements

Comments»

1. Eric Pugh - September 5, 2008

This looks very cool.. I am looking at using daemon_controller to automate starting up Memcache and Background RB..

I can’t wait to see your followon posting.. Does this integrate nicely into your deployment scripts? I am using Vlad and I have a special commands to start up background rb:

remote_task :start_app, :roles => :app do
run “cd #{current_path}; ./script/backgroundrb start -e production”
end

desc “Stop the backgroundrb server”
remote_task :stop_app, :roles => :app do
run “cd #{current_path}; ./script/backgroundrb stop”
end

2. John Dewey - September 5, 2008

Hi Eric –

I implemented it for starting memcached in development mode only. You could use the technique explained in the next post, to start/stop in any environment.

You shouldn’t need to hook into vlad, since it will automatically start on rails initialization.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: