I use XML to configure, it's easier for me to test with at the moment.
<uwsgi>
<vhost-host/>
<master/>
<gid>www-data</gid>
<uid>www-data</uid>
<catch-exceptions/>
<chmod-socket/>
<idle>600</idle>
<max-requests>1000</max-requests>
<processes>4</processes>
<threads>50</threads>
<no-orphans/>
<enable-threads/>
<reload-mercy>5</reload-mercy>
<socket>/var/tmp/uwsgi.sock</socket>
<pidfile>/var/run/uwsgi.pid</pidfile>
<!-- <daemonize>/var/log/uwsgi.log</daemonize> -->
<!-- <disable-logging/> -->
<vacuum/>
<!-- <no-default-app/> This option can return errors while an app
is initializing. -->
<!-- <reload-on-rss>128</reload-on-rss> Reload at 128MB of RSS
(memory usage) -->
</uwsgi>
nginx:
location / {
include uwsgi_params;
uwsgi_pass unix:///var/tmp/uwsgi.sock;
uwsgi_param UWSGI_SCRIPT module.wsgi;
uwsgi_param UWSGI_CHDIR /home/app/;
uwsgi_param UWSGI_TOUCH_RELOAD /home/app/module/wsgi.py;
}
After touching the file once, it reloads every single time.
2011/6/21 Łukasz Czuja <[email protected]>:
> I've discovered something simillar lately (somewhere between 0.9.7.2 and
> 0.9.8, haven't tested in on the official 0.9.8, only commits in between)
> when using uwsgi in --lazy mode (single process, no emperor, just one mgmt
> process, py2.6). When uwsgi tries to create an application instance and that
> fails (for ex. because of invalid import), uwsgi keeps retrying but it
> constantly fails so an app is never created. But then if I try to end uwsgi
> process (sinal 3) it locks itself in infinite loop so KILL is necessary.
>
> I can provide more details if needed.
>
> W dniu 20.06.2011 03:52, Trey Long pisze:
>>
>> From a previous conversation I learned that TOUCH_RELOAD could be
>> passed as UWSGI variable. My current setup:
>>
>> server {
>> listen 8080;
>> server_name ...;
>>
>> location / {
>> include uwsgi_params;
>>
>> uwsgi_pass unix:///var/tmp/uwsgi.sock;
>> uwsgi_param UWSGI_CHDIR /appdir/;
>> uwsgi_param UWSGI_SCRIPT app.wsgi;
>> uwsgi_param UWSGI_TOUCH_RELOAD /appdir/app.wsgi;
>> }
>>
>> location /static/ {
>> root /appdir/static;
>> }
>> }
>>
>> This works fine, when I touch the file it does update. However, uWSGI
>> continuously spawns new interpreters to handle the same application.
>> It appears like the original mod time isn't updated when a new mod
>> time is detected and every subsequent comparison yields a new
>> interpreter instance:
>>
>> "WSGI application 10 (SCRIPT_NAME=ubuntu.local:8080|) ready on
>> interpreter 0x5868e90 pid: 15701 (default app)"
>>
>> Keep in mind I only have a single app in this setup.
>>
>> Trey
>> _______________________________________________
>> uWSGI mailing list
>> [email protected]
>> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>
> --
> Pozdrawiam,
>
> Łukasz Czuja
>
> Programista / Analityk / Architekt IT
>
> _______________________________________________
> uWSGI mailing list
> [email protected]
> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi