Two questions about uwsgi: *(1) Server one: *I have installed nginx+uwsgi using the script on a test server. web2py works fine, but the uwsgi.log file shows a new entry every second (marked red). And there is a warning (green) - how can I run uWSGI not as root? This is the logfile after a restart (sorry, I know, there are many lines):
*** Starting uWSGI 2.0.9 (64bit) on [Tue Feb 3 08:25:09 2015] *** compiled with version: 4.8.2 on 18 January 2015 11:43:22 os: Linux-3.13.0-44-generic #73-Ubuntu SMP Tue Dec 16 00:22:43 UTC 2014 machine: x86_64 clock source: unix detected number of CPU cores: 1 current working directory: / detected binary path: /usr/local/bin/uwsgi !!! no internal routing support, rebuild with pcre support !!! uWSGI running as root, you can use --uid/--gid/--chroot options *** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** your processes number limit is 15784 your memory page size is 4096 bytes detected max file descriptor number: 1024 lock engine: pthread robust mutexes thunder lock: disabled (you can enable it with --thunder-lock) Python version: 2.7.6 (default, Mar 22 2014, 23:03:41) [GCC 4.8.2] *** starting uWSGI Emperor *** *** has_emperor mode detected (fd: 6) *** [uWSGI] getting INI configuration from web2py.ini *** Starting uWSGI 2.0.9 (64bit) on [Tue Feb 3 08:25:09 2015] *** compiled with version: 4.8.2 on 18 January 2015 11:43:22 os: Linux-3.13.0-44-generic #73-Ubuntu SMP Tue Dec 16 00:22:43 UTC 2014 nodename: mweissen-test machine: x86_64 clock source: unix detected number of CPU cores: 1 current working directory: /etc/uwsgi detected binary path: /usr/local/bin/uwsgi !!! no internal routing support, rebuild with pcre support !!! setgid() to 33 set additional group 125 (dovecot) setuid() to 33 your processes number limit is 15784 limiting address space of processes... your process address space limit is 536870912 bytes (512 MB) your memory page size is 4096 bytes *** WARNING: you have enabled harakiri without post buffering. Slow upload could be rejected on post-unbuffered webservers *** detected max file descriptor number: 1024 lock engine: pthread robust mutexes thunder lock: disabled (you can enable it with --thunder-lock) uwsgi socket 0 bound to UNIX address /tmp/web2py.socket fd 3 Python version: 2.7.6 (default, Mar 22 2014, 23:03:41) [GCC 4.8.2] *** Python threads support is disabled. You can enable it with --enable-threads *** Python main interpreter initialized at 0x1865760 your mercy for graceful operations on workers is 60 seconds *** Operational MODE: no-workers *** spawned uWSGI master process (pid: 35875) *** Python threads support is disabled. You can enable it with --enable-threads *** Python main interpreter initialized at 0x1a07a90 your server socket listen backlog is limited to 100 connections your mercy for graceful operations on workers is 60 seconds [uwsgi-cron] command "python /home/www-data/web2py/web2py.py -Q -S welcome -M -R scripts/sessions2trash.py -A -o" registered as cron task mapped 363840 bytes (355 KB) for 4 cores *** Operational MODE: preforking *** added /home/www-data/web2py/ to pythonpath. mounting wsgihandler:application on / worker 1 killed successfully (pid: 35873) Respawned uWSGI worker 1 (new pid: 35885) mapping worker 1 to CPUs: 0 emperor-i-am-ready-to-accept/write(): Bad file descriptor [core/uwsgi.c line 3453] Tue Feb 3 08:25:09 2015 - lost communication with the Emperor, goodbye... Tue Feb 3 08:25:09 2015 - graceful shutdown triggered... Gracefully killing worker 1 (pid: 35885)... WSGI app 0 (mountpoint='/') ready in 0 seconds on interpreter 0x1a07a90 pid: 35878 (default app) *** uWSGI is running in multiple interpreter mode *** spawned uWSGI master process (pid: 35878) Tue Feb 3 08:25:09 2015 - [emperor] vassal web2py.ini has been spawned spawned uWSGI worker 1 (pid: 35888, cores: 1) spawned uWSGI worker 2 (pid: 35889, cores: 1) spawned uWSGI worker 3 (pid: 35890, cores: 1) spawned uWSGI worker 4 (pid: 35891, cores: 1) *** Stats server enabled on /tmp/stats.socket fd: 16 *** mapping worker 2 to CPUs: 0 mapping worker 3 to CPUs: 0 mapping worker 4 to CPUs: 0 mapping worker 1 to CPUs: 0 Tue Feb 3 08:25:09 2015 - [emperor] vassal web2py.ini is ready to accept requests worker 1 killed successfully (pid: 35885) worker respawning too fast !!! i have to sleep a bit (2 seconds)... Respawned uWSGI worker 1 (new pid: 35892) mapping worker 1 to CPUs: 0 emperor-i-am-ready-to-accept/write(): Bad file descriptor [core/uwsgi.c line 3453] Tue Feb 3 08:25:12 2015 - lost communication with the Emperor, goodbye... Tue Feb 3 08:25:12 2015 - graceful shutdown triggered... Gracefully killing worker 1 (pid: 35892)... worker 1 killed successfully (pid: 35892) Respawned uWSGI worker 1 (new pid: 35893) mapping worker 1 to CPUs: 0 emperor-i-am-ready-to-accept/write(): Bad file descriptor [core/uwsgi.c line 3453] Tue Feb 3 08:25:13 2015 - lost communication with the Emperor, goodbye... Tue Feb 3 08:25:13 2015 - graceful shutdown triggered... Gracefully killing worker 1 (pid: 35893)... worker 1 killed successfully (pid: 35893) *(2) Server two* (for the production): it should be the same installation, but now the uwsgi.log file contains: mounting wsgihandler:application on / spawned uWSGI master process (pid: 1167) Traceback (most recent call last): File "/home/www-data/web2py/wsgihandler.py", line 37, in <module> import gluon.main File "/home/www-data/web2py/gluon/__init__.py", line 15, in <module> from globals import current File "/home/www-data/web2py/gluon/globals.py", line 21, in <module> from gluon.html import xmlescape, TABLE, TR, PRE, URL File "/home/www-data/web2py/gluon/html.py", line 34, in <module> from gluon.utils import web2py_uuid, simple_hash, compare File "/home/www-data/web2py/gluon/utils.py", line 44, in <module> import hmac File "/usr/local/lib/python2.7/hmac.py", line 8, in <module> from operator import _compare_digest as compare_digest ImportError: cannot import name _compare_digest unable to load app 0 (mountpoint='/') (callable not found or import error) *** no app loaded. going in full dynamic mode *** *** uWSGI is running in multiple interpreter mode *** spawned uWSGI master process (pid: 1213) Tue Feb 3 08:12:12 2015 - [emperor] vassal web2py.ini has been spawned spawned uWSGI worker 1 (pid: 1310, cores: 1) mapping worker 1 to CPUs: 0 spawned uWSGI worker 2 (pid: 1311, cores: 1) spawned uWSGI worker 3 (pid: 1312, cores: 1) spawned uWSGI worker 4 (pid: 1313, cores: 1) *** Stats server enabled on /tmp/stats.socket fd: 16 *** mapping worker 4 to CPUs: 1 mapping worker 2 to CPUs: 1 Tue Feb 3 08:12:12 2015 - [emperor] vassal web2py.ini is ready to accept requests mapping worker 3 to CPUs: 0 I have spent some hours, but I could not find a solution. Who can give me a hint? Regards, Martin -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.