[CalendarServer-users] Multiple Memcached servers

Rob Archibald rob at robarchibald.com
Sat Feb 18 19:18:54 PST 2017


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

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-users/attachments/20170218/1ed1f2b1/attachment.html>


More information about the calendarserver-users mailing list