forked from basecamp/libmemcached_store
-
Notifications
You must be signed in to change notification settings - Fork 2
/
README
51 lines (31 loc) · 1.65 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
= LibmemcachedStore
An ActiveSupport cache store that uses the C-based libmemcached client through
Evan Weaver's Ruby/SWIG wrapper, memcached. libmemcached is fast, lightweight,
and supports consistent hashing, non-blocking IO, and graceful server failover.
== Prerequisites
You'll need both the libmemcached client and the memcached gem:
* http://tangent.org/552/libmemcached.html
* http://blog.evanweaver.com/files/doc/fauna/memcached
Make sure you install libmemcached first, before you try installing the gem. If
you're using OS X, the easiest way to install libmemcached is through MacPorts:
sudo port install libmemcached
For other platforms, download and extract the libmemcached tarball and install
manually:
./configure
make && sudo make install
Once libmemcached is installed, install the memcached gem:
gem install memcached --no-rdoc --no-ri
== Usage
This is a drop-in replacement for the memcache store that ships with Rails. To
enable, set the <tt>config.cache_store</tt> option to <tt>:libmemcached_store</tt>
in the config for your environment
config.cache_store = :libmemcached_store
If no servers are specified, localhost is assumed. You can specify a list of
server addresses, either as hostnames or IP addresses, with or without a port
designation. If no port is given, 11211 is assumed:
config.cache_store = :libmemcached_store, %w(cache-01 cache-02 127.0.0.1:11212)
You can also use <tt>:libmemcached_store</tt> with <tt>config.session_store</tt>
config.session_store = :libmemcached_store
== Props
Thanks to Brian Aker (http://tangent.org) for creating libmemcached, and Evan
Weaver (http://blog.evanweaver.com) for the Ruby wrapper.