On Thu, Jan 31, 2013 at 11:56 AM, Roberto De Ioris <[email protected]> wrote:
> The only "uncommon" thing is the usage of multiple sockets (it should not > be a problem, but who knows... :P) > > Can you paste your webserver config too ? (maybe there is something > breaking graceful reload there) > > The multiple sockets is a weird requirement, sometimes a tcp port just "breaks"; details @ http://ubuntuforums.org/showthread.php?t=1208121, so when we detect an abnormal rate of connect failures, we switch to port+1 until a reboot resets it. The nginx config is as simple as it can be, I think. I've tried the uwsgi binary protocol before, but as it had the same graceful reload issue, we settled back on http for easy testing - direct connect to socket with web browser after upgrade & touch to verify everything works. Here's the nginx server and upstream config: upstream wol-uwsgi { > # frontend01 > server [redacted]:7654 weight=3 max_fails=5 fail_timeout=10; > # frontend02 > server [redacted]:7655 weight=3 max_fails=5 fail_timeout=10; > # twin2 > server [redacted]:7655 weight=3 max_fails=5 fail_timeout=10; > } > > server { > listen 80; > server_name [redacted] > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For $remote_addr; > proxy_read_timeout 20; > proxy_send_timeout 20; > proxy_connect_timeout 10; > proxy_next_upstream error timeout; > location / { > # Dynamic pages are rate limited to 2/s, burst up to 15 > limit_req zone=wol burst=15 nodelay; > proxy_pass http://wol-uwsgi; > #proxy_pass http://wol; # maintenance > } > location /api/ { > # API is not rate limited > proxy_pass http://wol-uwsgi; > #proxy_pass http://wol; # maintenance > } > location /media/ { > proxy_pass http://wol; > } The wol upstream is the Apache instance, it has a rewrite rule that serves existing static files first before the .wsgi handler; mostly historical, haven't taken the time to remove it yet as nginx does static just as well. Kind regards, Chi Ho Kwok > -- > Roberto De Ioris > http://unbit.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
