I recommend you to use nginx between ELB and uWSGI. ELB expects HTTP server supporting keep-alive, but uWSGI doesn't support it.
On Tue, Jul 7, 2015 at 3:08 PM, Curtis Maloney <[email protected]> wrote: > Solved... sort of. > > On IRC unbit asked me to add "add-header: Connection: close" in my vassal > config, and the problem has vanished. > > Obviously this is not ideal, but for anyone else who encounters this > problem, this work around is here until a "true" fix is discovered. > > -- > Curtis > > > > On 07/07/15 12:59, Curtis Maloney wrote: > >> Greetings, all... >> >> We've recently started trialling using uwsgi HTTP workers in place of >> nginx, and generally it works great. >> >> However, when sitting behind ELB, we can trivially cause a condition >> where ELB returns a 504, and [interpreting their sparse logging details >> through their docs] it appears it believes uWSGI has closed the socket >> before the timeout. >> >> However, uWSGI doesn't log anything I can find. >> >> I'm wondering if it's possible the offload threads are racing something, >> but with no logging it's impossible to tell. >> >> So my questions are really: >> 1. How can I crank up some logging to see what's failing where? >> 2. Is this a known issue I can configure around? >> >> >> >> Using uWSGI 2.0.11 installed with pip >> >> General config: >> >> uWSGI emperor scanning for /srv/www/*/uwsgi.ini >> >> /srv/www/_/uwsgi.ini >> >> Runs 10 http workers, and a http subscription server. >> >> >> /srv/www/*/uwsgi.ini >> >> a bunch of instances of the same app, configured for clients. >> >> All use the same config, symlinked into place. >> >> Salient config options: >> >> [uwsgi] >> uid = www-data >> gid = www-data >> >> master = true >> procname-prefix = %c- >> processes = 4 >> threads = 4 >> cheaper = 1 >> chdir = %d >> >> # Logging >> ; plugin = logfile >> logger = file:logs/uwsgi.log >> log-x-forwarded-for = true >> log-5xx = true >> >> # Static / Media >> static-map = /static=html/static >> static-map = /media=html/media >> # Check for pre-compressed versions >> static-gzip-ext = css >> static-gzip-ext = js >> >> # Workers for static/media serving >> offload-threads = %k >> >> # Tell the router we're here >> subscribe-to = 127.0.0.1:8001:%c.mysite.com >> >> post-buffering = 1 >> # Prevent memory exhaustion >> reload-on-rss = 400 >> >> memory-report = true >> stats-server = %dlogs/stats.sock >> >> >> >> -- >> Curtis >> _______________________________________________ >> 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 > -- INADA Naoki <[email protected]>
_______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
