asking how to deploy with 0 downtime

hey
I am using Django with Gunicorn in production
I have a deploy script, and part of it is sudo supervisorctl restart my_gunicorn_django

Once I deploy, I have a little time during which the server does not respond to requests, and I would like to minimize it, how would you recommend to do it?

my supervisoctl conf:


[program:my_gunicorn_django]

directory=…

command=/home/ubuntu/env/bin/gunicorn --workers 3 --bind unix:/var/run/my_gunicorn_django.sock backend.wsgi:application

autostart=true

autorestart=true

stderr_logfile=/var/log/gunicorn/my_gunicorn_django.err.log

stdout_logfile=/var/log/gunicorn/my_gunicorn_django.out.log

programs:gunicorn

Thank you for any advice!

You probably need the full path here.

Also, did you try to reload? sudo supervisorctl reload my_gunicorn_django

1 Like

There is a full path there, it’s /home/ubuntu/, thank you.
And no, I did not try reloadI was thinking reload is when updating to the supervisor conf.
In my next deploy, I will try reload to see if there is lower downtime and really restarts the workers

based on supervisor ( Running Supervisor — Supervisor 4.3.0 documentation )

reload
Restarts the remote supervisord

restart <name>
Restart a process Note: restart does not reread config files. For that, see reread and update.

I also uploaded what ChatGPT says about the difference between reload and restartIf it’s interesting for anyone

1 Like