Graceful deploys for gunicorn. Turns out a HUP signal to the docker container isn't the same thing as a HUP signal to the actual process, which can be done outside of the container.

This commit is contained in:
Samuel Clay 2021-03-26 18:44:56 -04:00
parent 03ddd83e08
commit 55a200a5b3
2 changed files with 7 additions and 1 deletions

View file

@ -20,7 +20,12 @@
- name: Reload gunicorn
become: yes
command: "docker kill --signal=HUP newsblur_web"
block:
- name: Find gunicorn master process
shell: "ps -C gunicorn fch -o pid | head -n 1"
register: psaux
- name: Reload gunicorn
command: "kill -HUP {{ psaux.stdout }}"
# when: pulled.changed
- name: Start Consul

View file

@ -18,6 +18,7 @@ x_forwarded_for_header = "X-FORWARDED-FOR"
forwarded_allow_ips = "*"
limit_request_line = 16000
limit_request_fields = 1000
worker_tmp_dir = /dev/shm
if GIGS_OF_MEMORY > NUM_CPUS:
workers = NUM_CPUS