Skip to content

Commit

Permalink
Provide robust Gunicorn config in multiprocess docs
Browse files Browse the repository at this point in the history
We need to use the recently added Gunicorn `child_exited` callback in order to
correctly clean up after a segfaulted or OOM-killed worker (for details, see
benoitc/gunicorn#1394).
  • Loading branch information
StephanErb committed Mar 21, 2017
1 parent 36b5cab commit 1aee39d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,9 @@ between Gunicorn runs (before startup is recommended).

Put the following in the config file:
```python
def worker_exit(server, worker):
from prometheus_client import multiprocess
from prometheus_client import multiprocess

def child_exit(server, worker):
multiprocess.mark_process_dead(worker.pid)
```

Expand Down

0 comments on commit 1aee39d

Please sign in to comment.