Forums

504-backend error - worker being sent signal 9

Over the last week or so, a Django view that we call to generate a large .csv file has been erroring out. Looking at the server error log, we seem to be getting messages similar to this:

2023-03-14 11:56:53 Tue Mar 14 11:56:52 2023 - *** HARAKIRI ON WORKER 2 (pid: 13, try: 1) ***
2023-03-14 11:56:53 Tue Mar 14 11:56:52 2023 - HARAKIRI !!! worker 2 status !!!
2023-03-14 11:56:53 Tue Mar 14 11:56:52 2023 - HARAKIRI [core 0] 10.0.0.83 - GET /dashboard/data_download/csv/23/long-term/2023-02-01/2023-02-28/ since 1678794711
2023-03-14 11:56:53 Tue Mar 14 11:56:52 2023 - HARAKIRI !!! end of worker 2 status !!!
2023-03-14 11:56:53 DAMN ! worker 2 (pid: 13) died, killed by signal 9 :( trying respawn ...
2023-03-14 11:56:53 Respawned uWSGI worker 2 (new pid: 16)
2023-03-14 11:56:53 spawned 2 offload threads for uWSGI worker 2

The code does a lot of data collection and processing from our large Postgres database, so is it just a case that the worker is running out of time or memory?

This error has only been occurring recently, so have the timeout / memory limits changed for our workers? Or, is there an underlying issue on our Postgres server that is slowing it down?

Is there any account upgrade that we can apply to boost performance in this case?

Any advice or suggestions would be greatly appreciated!

Thanks, Andy

If it's getting a signal 9, that suggests that it's probably running out of memory. You will not be able to upgrade to get change that behaviour. Your best bet would be to optimise you code so it does not have to keep so much in memory.