Harakiri on worker


I've developed an application that runs several forecasts using python.

But after a while the program stucks and displays this message:

HARAKIRI ON WORKER 1 (pid: 4, try: 1) HARAKIRI !!! worker 1 status !!! HARAKIRI [core 0] - GET /consGral?listavariable=Laboratory&tipocons=ForecastAll since 1531345867 HARAKIRI !!! end of worker 1 status !!! DAMN ! worker 1 (pid: 4) died, killed by signal 9 :( trying respawn ...

And it just don't respond any more.

Why is it happening?


for your webapp, anything longer than 5min would be considered as the web worker being frozen and killed. is that what's happening here?

That's exactly whats happening there.

My webapp makes thousands of forecasts (about 6,000 time series) to update the information of my user, so it would lasts at least 40 minutes to be updated.

I have a paid account with 3 workers.

What would be the best solution to avoid this behavior?

Should I get more workers in my web app?

Should I use a time.sleep() within my algorithm every 5 minutes?

Thanks a lot

you should run the actual forecasts/number crunching offline (eg: from a scheduled task/long running task queue). the webapp should just put stuff onto the queue or display the results of the number crunching.

otherwise someone could just DoS your website by hitting it 3 times to do 3 forecasts, and you wouldn't be able to access it for 40min etc.