Hi all, first post here :)
I'm using virtualhosting mode in 0.9.6.* to serve various pylons
applications (well, actually it's always the same app) and it's working
great.
Today I was checking out 0.9.8 and I discovered a change in the
behaviour, it seems that now uWSGI spawn a new app for every request.
In 0.9.6.8 I get a new app for every hostname/script_name pair, while
with 0.9.8 I get a new app for every request, I don't see the hostname
in the logs anymore. This slows down every request and increase memory
usage a lot.
I've attached two short logs where it's clearly visible the difference.
I did not change nginx configuration nor the uswgi commandline.
uwsgi commandline:
/usr/bin/uwsgi -s /var/run/uwsgi.sock --no-site --vhost -M --vacuum
--log-5xx
nginx conf (simplified):
server {
listen 8080 default_server;
access_log /var/log/apps/access_log main;
error_log /var/log/apps/error_log info;
set $hostroot /srv/www/apps/$host;
root $hostroot;
location / {
uwsgi_pass unix:///var/run/uwsgi.sock;
include uwsgi_params;
uwsgi_param SCRIPT_NAME "";
uwsgi_param UWSGI_SCRIPT main;
uwsgi_param UWSGI_PYHOME /srv/virtualenvs/aybu;
uwsgi_param UWSGI_CHDIR $hostroot;
}
}
That way every app is served from /srv/www/apps where I create a
directory for each domain I want to serve.
The main.py module (in each domain directory) initialize the paster
logging framework and calls paste.deploy.loadapp().
Am I doing something wrong with 0.9.8?
Thanks,
--
Giacomo Bagnoli
*** Starting uWSGI 0.9.6.8 (64bit) on [Fri Jun 17 12:31:17 2011] ***
compiled with version: 4.5.2
Python version: 2.7.1 (r271:86832, Mar 22 2011, 10:17:02) [GCC 4.5.2]
your memory page size is 4096 bytes
allocated 640 bytes (0 KB) for 1 request's buffer.
VirtualHosting mode enabled.
binding on UNIX socket: /var/run/uwsgi.sock
your server socket listen backlog is limited to 100 connections
initializing hooks...done.
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 28820)
spawned uWSGI worker 1 (pid: 28830)
interpreter for app 0 initialized.
application 0 (localhost|) ready
setting default application to 0
localhost [pid: 28830|app: 0|req: 1/1] 127.0.0.1 () {48 vars in 792 bytes} [Fri
Jun 17 12:31:58 2011] GET / => generated 243 bytes in 900 msecs (HTTP/1.1 302)
5 headers in 168 bytes (0 async switches on async core 0)
localhost [pid: 28830|app: 0|req: 2/2] 127.0.0.1 () {48 vars in 818 bytes} [Fri
Jun 17 12:31:59 2011] GET /en/index.html => generated 4561 bytes in 10 msecs
(HTTP/1.1 200) 3 headers in 145 bytes (0 async switches on async core 0)
*** Starting uWSGI 0.9.8 (64bit) on [Fri Jun 17 12:09:18 2011] ***
compiled with version: 4.5.2 on 17 June 2011 11:05:41
your memory page size is 4096 bytes
VirtualHosting mode enabled.
uwsgi socket 0 bound to UNIX address /var/run/uwsgi.sock fd 4
Python version: 2.7.1 (r271:86832, Mar 22 2011, 10:17:02) [GCC 4.5.2]
Python main interpreter initialized at 0x655960
your server socket listen backlog is limited to 100 connections
*** Operational MODE: single process ***
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 25687)
spawned uWSGI worker 1 (pid: 25697, cores: 1)
WSGI application 1 (SCRIPT_NAME=) ready on interpreter 0x6f24a0 pid: 25697
(default app)
[pid: 25697|app: 1|req: 1/1] 127.0.0.1 () {48 vars in 795 bytes} [Fri Jun 17
12:09:35 2011] GET / => generated 245 bytes in 956 msecs (HTTP/1.1 302) 5
headers in 169 bytes (1 switches on core 0)
WSGI application 2 (SCRIPT_NAME=) ready on interpreter 0x16da4e0 pid: 25697
(default app)
[pid: 25697|app: 2|req: 1/2] 127.0.0.1 () {46 vars in 768 bytes} [Fri Jun 17
12:09:36 2011] GET / => generated 245 bytes in 985 msecs (HTTP/1.1 302) 5
headers in 169 bytes (1 switches on core 0)
WSGI application 3 (SCRIPT_NAME=) ready on interpreter 0x11eb5b0 pid: 25697
(default app)
[pid: 25697|app: 3|req: 1/3] 127.0.0.1 () {46 vars in 794 bytes} [Fri Jun 17
12:09:37 2011] GET /en/index.html => generated 4561 bytes in 913 msecs
(HTTP/1.1 200) 3 headers in 145 bytes (1 switches on core 0)
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi