about summary refs log tree commit homepage
path: root/SIGNALS
DateCommit message (Collapse)
2013-12-09rework master-to-worker signaling to use a pipe
Signaling using normal kill(2) is preserved, but the master now prefers to signal workers using a pipe rather than kill(2). Non-graceful signals (:TERM/:KILL) are still sent using kill(2), as they ask for immediate shutdown. This change is necessary to avoid triggering the ubf (unblocking function) for rb_thread_call_without_gvl (and similar) functions extensions. Most notably, this fixes compatibility with newer versions of the 'pg' gem which will cancel a running DB query if signaled[1]. This also has the nice side-effect of allowing a premature master death (assuming preload_app didn't cause the master to spawn off rogue child daemons). Note: users should also refrain from using "killall" if using the 'pg' gem or something like it. Unfortunately, this increases FD usage in the master as the writable end of the pipe is preserved in the master. This limit the number of worker processes the master may run to the open file limit of the master process. Increasing the open file limit of the master process may be needed. However, the FD use on the workers is reduced by one as the internal self-pipe is no longer used. Thus, overall pipe allocation for the kernel remains unchanged. [1] - pg is correct to cancel a query, as it cannot know if the signal was for a) graceful unicorn shutdown or b) oh-noes-I-started-a-bad-query-ABORT-ABORT-ABORT!!
2013-11-26doc: clarify SIGNALS and reference init example
"interactive terminal" needed clarification. While we're at it, link to the init.sh example since it may be shared with nginx. Reported-by: Rodrigo Rosenfeld Rosas ref: <5294E9D4.5030608@gmail.com>
2010-06-10docs: hopefully clarify preload_app=false behavior
While we're at it, inform people of why they might use a symlink
2009-11-18SIGNALS: HUP + preload_app cannot reload app code
This is already documented in Configurator RDoc, but put it here just in case people don't read all the documentation.
2009-11-14preserve user/group ownership when reopening logs
This is only supported when SIGUSR1 is sent only to the master process (which then resends SIGUSR1 to the workers). Since we only added support for user/group switching in the workers, we now chown any log files upon switching users so the master can pick up and chown the log files later on. Thus we can avoid having to restart workers because they fail to rotate log files on their own.
2009-10-02SIGNALS: state that we stole semantics from nginx
2009-09-15SIGNALS: use "Unicorn" when referring to the web server
"unicorn" (lower-case) refers to the executable script
2009-09-07doc/SIGNALS: fix the no-longer-true bit about socket options
This hasn't been true since 3e9fe197d4daac14fa98addfcf9be3208c7b96b8
2009-05-28SIGHUP reloads app even if preload_app is true
This makes SIGHUP handling more consistent across different configurations, and allows togging preload_app to take effect when SIGHUP is issued.
2009-04-24doc: formatting changes for SIGNALS doc
2009-04-24SIGTT{IN,OU} {in,de}crements worker_processes
This allows dynamic tuning of the worker_processes count without having to restart existing ones. This also allows worker_processes to be set to a low initial amount in the config file for low-traffic deployments/upgrades and then scaled up as the old processes are killed off. Remove the proposed reexec_worker_processes from TODO since this is far more flexible and powerful. This will allow not-yet-existent third-party monitoring tools to dynamically change and scale worker processes according to site load without increasing the complexity of Unicorn itself.
2009-04-03Documentation updates
Reword and expand a bit
2009-04-01Documentation updates, prep for 0.4.1 release
2009-03-19Trap WINCH to QUIT children without respawning
This will only be enabled if we're daemonized and "real" WINCH signals cannot be generated by resizing the terminal. This is to avoid confusing developers who run in the foreground of a terminal. Additionally document procedures for reexecuting a running binary.
2009-03-18gracefully die if working dir is invalid at fork
In nearly every app, if the current working directory disappears, the app becomes broken, sometimes subtly. It can be especially broken when preload_app is false (the default). So just shut ourselves down to spare ourselves the wasted CPU cycles on a dead app. As a (hopefully) pleasant side effect, this allows configurations with preload_app==false (the default) to do application code reloads via SIGHUP (in addition to unicorn config reloads).
2009-03-09Documentation updates
Reformat README to avoid preformatted text. Document signal handling in SIGNALS. Split out DESIGN, it's probably not as useful to end-users Update CONTRIBUTORS LICENSE: copyright is for me (Eric Wong), not Zed since this is a Mongrel fork.