Forums

Cherrypy increase timeout for response

Hi guys,

I have a webapp deployed with cherrypy that involves a lot of computation, so I think the response request is timing out and causing the app to crash with the following error

2016-05-25 14:56:58 Wed May 25 14:56:57 2016 - *** HARAKIRI ON WORKER 1 (pid: 16454, try: 1) *** 2016-05-25 14:56:58 Wed May 25 14:56:57 2016 - HARAKIRI !!! worker 1 status !!! 2016-05-25 14:56:58 Wed May 25 14:56:57 2016 - HARAKIRI [core 0] 10.99.195.139 - GET /app7/plot?ticker=9&upstream_range=float-466&downstream_range=__float__1227&cluster_ticker=clustering&number_of_clusters=8&output_id=anchor_plot& since 1464187916 2016-05-25 14:56:58 Wed May 25 14:56:57 2016 - HARAKIRI !!! end of worker 1 status !!! 2016-05-25 14:56:58 DAMN ! worker 1 (pid: 16454) died, killed by signal 9 :( trying respawn ... 2016-05-25 14:56:58 Respawned uWSGI worker 1 (new pid: 16511) 2016-05-25 14:56:58 spawned 2 offload threads for uWSGI worker 1

I know the app works if i perform the same computations with less data (it also works locally and I am assuming that is because the local server is faster). Is there a way to increase the get response time in cherrypy so that the app doesn't crash?

Nope. The harakiri is performed by our infrastructure after 5 min. That's a reeeeeaaalllllly long when you're delivering a web page. The assumption is that a web request that has not been handled in 5 min is severely broken in some way.

If you need to do that amount of processing you should do it offline and then only use the web app to deliver the results.

Ok Thanks for the help.

I already fixed it, I guess it was a good excuse to optimize the code.