Mark Sapiro writes:
On 11/18/21 6:38 AM, Andrew Hodgson wrote:
Ok thanks for this. Its happening because the Gunicorn process running the Django server is being killed due to OOM conditions. Is there any settings I can change to troubleshoot/throttle this in Gunicorn or Django?
I don't think there's anything that can be done in gunicorn or django about this. This is an OS issue. You need to give the server more memory or allocate a (bigger) swap file.
If those things are difficult, depending on OS and the hardware, it may also be possible to tell the OS that gunicorn is an import process that should not be killed. But in the long run, the server needs more memory.
In theory there could be a memory leak in Python or one of the Mailman apps, but I haven't heard of it. And at least the Linux kernel seems to be perfectly happy to kill random processes that are well-behaved. So the fact gunicorn is getting killed is not strong evidence that it's causing the memory pressure, we'd really need to see the stats.
Steve