Server on multiple machines

andrew at flypublishing.com andrew at flypublishing.com
Fri Apr 20 12:21:15 UTC 2007


it does a hash on the key.  In ruby I use:

memcache_options = {
   :c_threshold => 10_000,
   :compression => true,
   :debug => false,
   :namespace => 'ANYTHING',
   :readonly => false,
   :urlencode => false
}

memcache_servers = [ 'machine1:8080, machine2:8080' ]

CACHE = MemCache.new(memcache_options)
CACHE.servers = memcache_servers

So CACHE[1] might hit machine1 and CACHE[2] might hit machine2...

On 4/20/07, Cristian Rusu <crirus at gmail.com> wrote:
> Hello
>
> I may not understand correctly, but how do I start and use memcached on
> multiple servers for same purpose.
> I know API client connect to one machine... how does memcached know there
> are like 2-3 other instances to look at when I query something for example.
>
> Thanks.
>
> --
> Sincerely
> Cristian Rusu
> Web Programmer & Electronic publisher


More information about the memcached mailing list