From e5242d4fdebfa67b4fde68c931d9e0f47999384d Mon Sep 17 00:00:00 2001 From: benoitc Date: Sat, 29 Jun 2013 06:04:51 +0200 Subject: [PATCH] add signals doc add a brief description of the signals handled by Gunicorn. fix #319 --- docs/source/index.rst | 1 + docs/source/signals.txt | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 docs/source/signals.txt diff --git a/docs/source/index.rst b/docs/source/index.rst index 3ec82912..b0f2f311 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -41,6 +41,7 @@ Contents configure deploy design + signals community faq news diff --git a/docs/source/signals.txt b/docs/source/signals.txt new file mode 100644 index 00000000..16800ac1 --- /dev/null +++ b/docs/source/signals.txt @@ -0,0 +1,40 @@ +.. _signals: + +================ +Signals Handling +================ + +A brief description of the signals handled by Gunicorn, We also document the +signales used internally by Gunicorn to communicate with the workers. With the +exception of TTIN/TTOU the signals handling match the behaviour of `nginx +`. + +Master process +============== + +- **TERM**, **INT**: Quick shutdown +- **QUIT**: Graceful shutdwn. I waits for workers to finish their + current request before finishing until the *graceful timeout*. +- **HUP**: Reload the configuration, start the new worker processes with a new + configuration and gracefully shutdown older workers. If the application is + not preloaded (using the ``--preload`` option), Gunicorn will also load the + new version. +- **TTIN**: Increment the number of processes by one +- **TTOU**: Decrement the nunber of processes by one +- **USR1**: Reopen the log files +- **USR2**: Upgrade the Gunicorn on the fly. A separate **QUIT** signal should + be used to kill the old process. This signal can also be used to use the new + versions of pre-loaded applications. +- **WINCH**: Gracefully shutdown the worker processes when gunicorn is + daemonized. + +Worker process +============== + +Sending signals directly to the worker processes should not normally be +needed. If the master process is running, any exited worker will be +automatically respawned. + +- **TERM**, **INT**: Quick shutdown +- **QUIT**: Graceful shutdown +- **USR1**: Reopen the log files