On Sun, December 11, 2011 5:44 pm, Wietse Venema wrote:
> Combining memcache and proxymap
> -------------------------------
>
> It seems that memcache is best for (surprise) doing what it was
> designed for: a cache layer on top of a persistent database, where
> the cache is maintained by the clients of the persistent database.
>
> This means doing something like this:
>
> /etc/postfix/main.cf:
>     postscreen_cache_map = memcache:/etc/postfix/postscreen-cache
>
> /etc/postfix/postscreen-cache:
>     # Where is the memcache server?
>     hosts = host1:port1
>
>     # Where is the persistent database?
>     persistence = proxymap:inet:host2:port2:persistent-database
>
>     # Future: sharding (key hashing) to spread the load across
>     # multiple memory caches and persistent databases.

For memcache-level sharding (in the presence of dead/unreachable servers)
you could just do something similar to Cache::Memcached->get_sock and
Cache::Memcached::_hashfunc (see
http://code.livejournal.org/trac/memcached/browser/trunk/api/perl/lib/Cache/Memcached.pm).
Maybe for persistent sharding too, but they can use different functions
for selecting servers.

Reply via email to