How do I use Memcached?

Scalarium has a build-in memcached role. Just add this role and add any instance. If you use a Rails applicaiton, Scalarium will automatically provide the application with a memcached.yml configuration file in the config directory. Just read the Memcached server and port out of this file, e.g. in you environment.rb or production.rb:

$ cat config/environment.rb

Rails::Initializer.run do |config|
  ...
  memcache_yml = File.dirname(__FILE__) + "/memcached.yml"
  memcache_config = YAML.load(File.read(memcache_yml))[RAILS_ENV || 'development']
  config.cache_store = [:mem_cache_store, "#{memcache_config['host']}:#{memcache_config['port']}"]
end

If you don't use Rails, you can re-configure your application using the information in the Chef attribute tree. An example attribute node can be found here.