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

Roberto De Ioris roberto at unbit.it
Thu Oct 17 10:08:42 CEST 2013


> hi Roberto, I did the experiments and got the following results.
>
> dbrg-dell720-2 is the master, it started with no problem:
>
> [dbrg at dbrg-dell720-2 ~]$ uwsgi --socket :4040 --cache2
> name=master,items=100 --load-file-in-cache /etc/passwd
> *** Starting uWSGI 1.9.15-dev (64bit) on [Thu Oct 17 15:33:12 2013] ***
> compiled with version: 4.4.6 20110731 (Red Hat 4.4.6-3) on 29 August
> 2013 13:02:23
> os: Linux-2.6.32-220.el6.x86_64 #1 SMP Wed Nov 9 08:03:13 EST 2011
> nodename: dbrg-dell720-2
> machine: x86_64
> clock source: unix
> pcre jit disabled
> detected number of CPU cores: 24
> current working directory: /home/dbrg
> detected binary path: /usr/bin/uwsgi
> *** WARNING: you are running uWSGI without its master process manager ***
> your processes number limit is 1024
> your memory page size is 4096 bytes
> detected max file descriptor number: 1024
> lock engine: pthread robust mutexes
> *** Cache "master" initialized: 6MB (key: 2120 bytes, keys: 212000
> bytes, data: 6553600 bytes, bitmap: 0 bytes) preallocated ***
> [cache] stored "/etc/passwd" in "master"
> uwsgi socket 0 bound to TCP address :4040 fd 4
> Python version: 2.6.6 (r266:84292, Sep 12 2011, 14:03:14)  [GCC 4.4.5
> 20110214 (Red Hat 4.4.5-6)]
> *** Python threads support is disabled. You can enable it with
> --enable-threads ***
> Python main interpreter initialized at 0x24ac8d0
> your server socket listen backlog is limited to 100 connections
> your mercy for graceful operations on workers is 60 seconds
> mapped 72776 bytes (71 KB) for 1 cores
> *** Operational MODE: single process ***
> *** no app loaded. going in full dynamic mode ***
> *** uWSGI is running in multiple interpreter mode ***
> spawned uWSGI worker 1 (and the only) (pid: 30982, cores: 1)
>
> #########################
> dbrg-dell720-1 is the slave, it can not connect to the cache server
>
> [dbrg at dbrg-dell720-1 ~]$ uwsgi --socket :4041 --cache2
> name=master,items=100,sync=127.0.0.1:4040
> *** Starting uWSGI 1.9.15-dev (64bit) on [Thu Oct 17 15:33:47 2013] ***
> compiled with version: 4.4.6 20110731 (Red Hat 4.4.6-3) on 29 August
> 2013 13:02:23
> os: Linux-2.6.32-220.el6.x86_64 #1 SMP Wed Nov 9 08:03:13 EST 2011
> nodename: dbrg-dell720-1
> machine: x86_64
> clock source: unix
> pcre jit disabled
> detected number of CPU cores: 24
> current working directory: /home/dbrg
> detected binary path: /usr/sbin/uwsgi
> *** WARNING: you are running uWSGI without its master process manager ***
> your processes number limit is 1024
> your memory page size is 4096 bytes
> detected max file descriptor number: 1024
> lock engine: pthread robust mutexes
> *** Cache "master" initialized: 6MB (key: 2120 bytes, keys: 212000
> bytes, data: 6553600 bytes, bitmap: 0 bytes) preallocated ***
> [cache-sync] getting cache dump from 127.0.0.1:4040 ...
> [cache-sync] unable to connect to the cache server
>
> ###########################
> but if I start the slave instance on master (dbrg-dell720-2) as well,
> it can restore the item.
>
> [dbrg at dbrg-dell720-2 ~]$ uwsgi --socket :4041 --cache2
> name=master,items=100,sync=127.0.0.1:4040
> *** Starting uWSGI 1.9.15-dev (64bit) on [Thu Oct 17 15:37:13 2013] ***
> compiled with version: 4.4.6 20110731 (Red Hat 4.4.6-3) on 29 August
> 2013 13:02:23
> os: Linux-2.6.32-220.el6.x86_64 #1 SMP Wed Nov 9 08:03:13 EST 2011
> nodename: dbrg-dell720-2
> machine: x86_64
> clock source: unix
> pcre jit disabled
> detected number of CPU cores: 24
> current working directory: /home/dbrg
> detected binary path: /usr/bin/uwsgi
> *** WARNING: you are running uWSGI without its master process manager ***
> your processes number limit is 1024
> your memory page size is 4096 bytes
> detected max file descriptor number: 1024
> lock engine: pthread robust mutexes
> *** Cache "master" initialized: 6MB (key: 2120 bytes, keys: 212000
> bytes, data: 6553600 bytes, bitmap: 0 bytes) preallocated ***
> [cache-sync] getting cache dump from 127.0.0.1:4040 ...
> [uwsgi-cache] restored 1 items
> uwsgi socket 0 bound to TCP address :4041 fd 4
> Python version: 2.6.6 (r266:84292, Sep 12 2011, 14:03:14)  [GCC 4.4.5
> 20110214 (Red Hat 4.4.5-6)]
> *** Python threads support is disabled. You can enable it with
> --enable-threads ***
> Python main interpreter initialized at 0x1cf78e0
> your server socket listen backlog is limited to 100 connections
> your mercy for graceful operations on workers is 60 seconds
> mapped 72776 bytes (71 KB) for 1 cores
> *** Operational MODE: single process ***
> *** no app loaded. going in full dynamic mode ***
> *** uWSGI is running in multiple interpreter mode ***
> spawned uWSGI worker 1 (and the only) (pid: 31057, cores: 1)
>
>
> why does the slave instance not work on slave node? any more hints?
>
> thanks,
>
> lliu
>


Sorry if i have not understood correctly, but if you are using different
nodes you cannot use 127.0.0.1 address, you have to use their network
addresses (not the loopback).

I suppose this is why you did not get udp traffic too
-- 
Roberto De Ioris
http://unbit.it


More information about the uWSGI mailing list