[uWSGI] how to properly set nodes and udp in cache2 config

Lu Liu nudtlliu at gmail.com
Sat Oct 19 15:30:17 CEST 2013

i finally made it work. it's actually simpler than i thought. my final
config are:

on master node (ip=
cache2 = name=test-conf-cache,items=8192,blocksize=2048,store=/shared_disk/test_cache2.dump,nodes=

here i remove the udp= part which i think is not
necessary on master.

on slave node (ip=
cache2 = name=test-conf-cache,items=8192,blocksize=2048,sync=,udp=

this time the slave successfully connect to the cache server (master)
because i add an specific worker listening on port 4040 on master in
addition to those working on unix sockets. so i think the problem is
solved. again, many thanks for your help Roberto!



On Thu, Oct 17, 2013 at 11:37 PM, Roberto De Ioris <roberto at unbit.it> wrote:
>> yes, the master and slave are two different servers. the updates can
>> be propagated to slave after I use the following settings:
>> on master (ip=
>> cache2 =
>> name=test-conf-cache,items=8192,blocksize=2048,store=/shared_disk/test_cache2.dump,nodes=,udp=
>> and on slave (ip=
>> cache2 =
>> name=test-conf-cache,items=8192,blocksize=2048,store=/shared_disk/test_cache2.dump,udp=
>> now everything seems alright. but i am wondering if there will be some
>> problem in the future since you mentioned that i should not use the
>> store=/shared_disk/test_cache2.dump as a part of the config on slave
>> node. I tried setting sync, but failed. In fact, i cannot make the
>> master as a cache2 sync server because it works behind nginx via unix
>> sockets. The slave node cannot connect to the sync server whatever
>> sync address i set. So i guess to restore the initial data from a file
>> on shared disk is my only choice. Is this setting risky? what do you
>> think?
>> thanks,
> The problem is that if you sync while an update is in place you could get
> an inconsistent cache image.
> I would try understanding why sync=<node> does not work for the slave.
> Remember that sync happens via tcp so the <node> address is the same value
> of --socket of the uwsgi instance
> --
> Roberto De Ioris
> http://unbit.it
> _______________________________________________
> uWSGI mailing list
> uWSGI at lists.unbit.it
> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Dr.-Ing. Lu LIU
Department of Information Engineering,
National University of Defense Technology
Yanwachi 137
410073 Changsha, China
Former affiliation:
Department of Cartography,
Technische Universitaet Muenchen
Arcis street 21
80333 Munich, Germany
Website: http://www.carto-tum.de

More information about the uWSGI mailing list