1

I have a django application running that uses celery to run tasks. The tasks take between 8 and 10 hours to complete. In my local system, the application was running fine. I have a mid 2015 Macbook pro with an i7 processor and 16 gigs of RAM.

I recently deployed the application into a 2core 4GB server in AWS. Now the tasks are being killed. This is the exact error I get

Task handler raised error: WorkerLostError('Worker exited prematurely: signal 9 (SIGKILL) Job: 0.')

When I read on this, I came to know that this happens due to memory leakage or memory swap issues.

My question is, will increasing the memory in AWS solve the issue?

Sashaank
  • 880
  • 2
  • 20
  • 54
  • you can easily test it ... just shut down the ec2 instance, and then use the menu in the top right to use a server with more ram... afaik you can also mount swap memory and that should help as well ... – Joran Beasley Nov 03 '21 at 03:25
  • Also think of checking swap space and setting/adding if required https://stackoverflow.com/questions/17173972/how-do-you-add-swap-to-an-ec2-instance – leangaurav Nov 03 '21 at 04:17
  • 1
    Unexpected `SIGKILL` is out of memory most of the time. – jordanm Nov 03 '21 at 04:19
  • Check `dmesg` or `kern.log`! If your process got killed because it uses too much memory, it will be logged there. – Klaus D. Nov 03 '21 at 04:24
  • @KlausD. The dmesg states that the task was killed because of Out of Memory. But I am not sure why this happens as the total memory usage of the container is less than 3% of the total memory in the server – Sashaank Nov 03 '21 at 04:58
  • you mean the storage memory or the RAM memory? because if the task take 8 to 10 hours on your machine to complete then no way 4gb of ram is sufficient – Linh Nguyen Nov 03 '21 at 08:01
  • @LinhNguyen I meant RAM memory. I have the same code running off of docker containers in my local system. Each container is limited to 2GB RAM in the local system. I think that was the default setting and I did not even know about that. It works perfectly fine in the localsystem – Sashaank Nov 05 '21 at 16:08

0 Answers0