I started receiving this on one of 2 load balanced servers. Nginx's logs showed this:
upstream prematurely closed connection while reading response header from upstream
I tried restarting uwsgi:
restart uwsgi-emperor
Uwsgi restarted fine, but the problem still persisted. Uwsgi's log showed this:
Fatal Python error: Couldn't create autoTLSkey mapping
This was fixed by doubling the memory in the uwsgi config file (/etc/uwsgi/web2py.ini) from:
limit-as = 512
reload-on-as = 256
reload-on-rss = 192
to
limit-as = 1024
reload-on-as = 512
reload-on-rss = 384
and restarting uwsgi.
This helped me tremendously for a similar problem. I was calling pandas from web2py and nginx complained similarly till I doubled the memory as you suggest. Thx a lot!
ReplyDeleteAwesome! Glad I could help.
ReplyDelete