A
A
Alexander Karabanov2018-06-11 10:36:37
Django
Alexander Karabanov, 2018-06-11 10:36:37

Why are gunicorns consuming swap so much?

Hello.
fttb2qphyfpbwbn2k3re4av5bg8.png
This is the pattern that comes up from time to time. When the swap ends, the server will hang.
How to wean gunicorn from using swap so actively.
Memory on the server 25GB. Used somewhere around 15gb.
But that's not really that much of a problem, the problem is that these gunicorns can only be killed with kill -9
Stopping the process in supervisor is not enough. Stopping the supervisor itself is also not enough - the gunicorns still live.
What's wrong with them?
With such a config, supervisor launches them:

[program:svarka]
command=/var/www/svarka/data/www/svarka/env/bin/gunicorn svarka.wsgi:application --name svarka --workers 2 --max-requests 1024 --timeout 1200 --bind=unix:/var/www/svarka/data/tmp/svarka.sock
directory=/var/www/svarka/data/www/svarka
stdout_logfile=/var/www/svark/data/tmp/svarka.stdout.log
stderr_logfile=/var/www/svarkapskov/data/tmp/svarka.stderr.log
user=svarka

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Kitaev, 2018-06-12
@deliro

1. Most likely such a policy of using swap in the system
2. What kind of shit code do you have there that two workers ate 15GB of RAM and swap? )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question