> Hi All, > > We are running uwsgi + nginx in production with following configuration > for > Python (django) app. > > master = true > processes = 20 > max-requests = 1000 > > We see following issues in production: > > 1. nginx reports 502 and logs "unable to connect with upstream". Is there > way to log info from uwsgi to understand where (system call or networks) > workers are blocked?.
You can attach a strace to each of the workers (strace -p <pid>) or you can enable the --harakiri and --harakiri-verbose options to receive the process syscall status after N seconds. > > 2.uwsgi logs - "uWSGI listen queue of socket 4 full !!! (201/200)". We > have > increased from default 100 for listen queue to 200. > > 3. uwsgi logs - write(): Broken pipe [plugins/python/wsgi_subhandler.c > line > 235] - I suspect this is because nginx terminated the connection. exactly, this is caused by nginx > > We running the app in 5 CPU and 1.7 GB box - would like to understand how > to tune max-requests and processes parameters?. We have 200 MB free in > general and CPU is at 30% on an avg. > use the latest rc or the latest mercurial tip with the statsserver http://projects.unbit.it/uwsgi/wiki/StatsServer and uwsgitop https://github.com/unbit/uwsgitop. But probably you could fix the whole problem with only strace. Check your database too, expecially if it can manage 20 concurrent connections (generated by the 20 workers). -- Roberto De Ioris http://unbit.it _______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
