[CalendarServer-users] Multiple Memcached servers

Andre LaBranche dre at apple.com
Mon Feb 20 09:46:17 PST 2017


Hi,

CalendarServer doesn't have the ability to directly access more than one memcache server per pool, and although you can bind "HandleCacheTypes" to specific pools, that doesn't let you distribute data within a cachetype.

To properly spread the load across multiple memcache servers, there needs to be a strategy for mapping the keys to one of the memcache services, which is already a feature of couchbase, and is known to work with CalendarServer. In this setup, couchbase reverse proxies to other cousebase nodes for a non local key, a behavior implemented both in their server and / or a local process that has no data store and is just a proxy.

-dre

> On Feb 18, 2017, at 7:18 PM, Rob Archibald <rob at robarchibald.com> wrote:
> 
> One of the benefits of Memcached is that it allows you to spread caching load across multiple servers. From looking at the config file for Calendar Server, it looked initially to me that it would support multiple Memcached servers, but now I guess I’m not so sure.  This is how php handles multi-server configuration:
>  
> $MEMCACHE_SERVERS = array(
>     "10.1.1.1", //web1
>     "10.1.1.2", //web2
>    "10.1.1.3", //web3
> );
>  
> I did a quick search of the code and I think I’ve found the connection method for memcache. I found this in txdav/who/cache.py so let me know if I’ve gone to the wrong place. It looks like it is only able to handle one server (hightlighted below). Am I missing some secret method to allow for multi-server memcached?
>  
> def _getMemcacheClient(self, refresh=False):
>         """
>         Get the memcache client instance to use for caching.
>         @param refresh: whether or not to create a new memcache client
>         @type refresh: L{bool}
>         @return: the client to use
>         @rtype: L{memcacheclient.Client}
>         """
>         if refresh or not hasattr(self, "memcacheClient"):
>             if config.Memcached.Pools.Default.MemcacheSocket:
>                 client_addr = "unix:{}".format(config.Memcached.Pools.Default.MemcacheSocket)
>             else:
>                 client_addr = "{}:{}".format(
>                     config.Memcached.Pools.Default.BindAddress,
>                     config.Memcached.Pools.Default.Port,
>                 )
>             self.memcacheClient = ClientFactory.getClient([client_addr], debug=0, pickleProtocol=2)
>         return self.memcacheClient
>  
> _______________________________________________
> calendarserver-users mailing list
> calendarserver-users at lists.macosforge.org
> https://lists.macosforge.org/mailman/listinfo/calendarserver-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-users/attachments/20170220/8ab3f040/attachment.html>


More information about the calendarserver-users mailing list