I've been recently testing out 2:1 concurrency (2 threads per process) instead of just 1:1, in order to get more out of Heroku dynos' limited memory.
When I switch threads to 2 in production, I start to see a bunch of premature Harakiri's. I have the `harakiri` setting to 25 seconds, but i see these much sooner, quite frequently and randomly, mostly for POST requests on a few select views. The following log snippet is illustrative of what is happening: Feb 11 11:08:04 stockton app/web.3: Wed Feb 11 19:08:04 2015 - *** HARAKIRI ON WORKER 5 (pid: 215, try: 1) *** Feb 11 11:08:04 stockton app/web.3: HARAKIRI: -- syscall> 7 0x7fffb0804570 0x1 0xfa0 0xc65f337e4f7fbfe7 0x3 0x38a71004160bee26 0x7fffb0804540 0x7f2fa9e89cc3 Feb 11 11:08:04 stockton app/web.3: HARAKIRI: -- wchan> poll_schedule_timeout Feb 11 11:08:04 stockton app/web.3: Wed Feb 11 19:08:04 2015 - HARAKIRI !!! worker 5 status !!! Feb 11 11:08:04 stockton app/web.3: Wed Feb 11 19:08:04 2015 - HARAKIRI [core 0] 10.68.129.226 - POST /admin/menus/food/256195/ since 1423681683 Feb 11 11:08:04 stockton app/web.3: Wed Feb 11 19:08:04 2015 - HARAKIRI !!! end of worker 5 status !!! Feb 11 11:08:04 stockton heroku/router: at=error code=H13 desc="Connection closed without response" method=POST path="/admin/menus/food/256195/" host= something.com request_id=111d5c11-fa66-452a-af95-4e76f4405739 fwd="0.0.246.97" dyno=web.3 connect=3ms service=1251ms status=503 bytes=0 Feb 11 11:22:19 stockton app/web.1: Wed Feb 11 19:22:19 2015 - *** HARAKIRI ON WORKER 3 (pid: 158, try: 1) *** Feb 11 11:22:19 stockton app/web.1: HARAKIRI: -- syscall> running Feb 11 11:22:19 stockton app/web.1: HARAKIRI: -- wchan> 0 Feb 11 11:22:19 stockton app/web.1: Wed Feb 11 19:22:19 2015 - HARAKIRI !!! worker 3 status !!! Feb 11 11:22:19 stockton app/web.1: Wed Feb 11 19:22:19 2015 - HARAKIRI [core 0] 10.4.105.38 - POST /admin/menus/menuweek/17446/ since 1423682539 Feb 11 11:22:19 stockton app/web.1: Wed Feb 11 19:22:19 2015 - HARAKIRI !!! end of worker 3 status !!! Feb 11 11:22:19 stockton heroku/router: at=error code=H13 desc="Connection closed without response" method=POST path="/admin/menus/menuweek/17446/" host=something.com request_id=bd50bd40-b0a2-4c91-a596-50d0beb552d0 fwd="0.0.68.34" dyno=web.1 connect=1ms service=225ms status=503 bytes=0 As you can see from the heroku/router lines, these requests are both cut off way below the 25 second harakiri threshold. Here is my uwsgi.ini file: [uwsgi] http-socket = :$(PORT) master = true enable-threads = true single-interpreter = true die-on-term = true harakiri = 25 harakiri-verbose reload-mercy = 8 max-requests = 2000 post-buffering = 4096 thunder-lock = true processes = 6 threads = 2 module = app.wsgi As soon as I set threads back to 1 per process, I no longer see this issue. Any ideas what might be causing this behavior? *uWSGI Version is 2.0.9* Thanks Ben Roberts
_______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
