diff options
Diffstat (limited to 'TUNING')
-rw-r--r-- | TUNING | 30 |
1 files changed, 22 insertions, 8 deletions
@@ -1,13 +1,32 @@ -= Tuning Unicorn += Tuning \Unicorn -Unicorn performance is generally as good as a (mostly) Ruby web server +\Unicorn performance is generally as good as a (mostly) Ruby web server can provide. Most often the performance bottleneck is in the web application running on Unicorn rather than Unicorn itself. -== Unicorn Configuration +== \Unicorn Configuration See Unicorn::Configurator for details on the config file format. +=== Unicorn::Configurator#worker_processes + +* worker_processes should be scaled to the number of processes your + backend system(s) can support. DO NOT scale it to the number of + external network clients your application expects to be serving. + \Unicorn is NOT for serving slow clients, that is the job of nginx. + +* worker_processes should be *at* *least* the number of CPU cores on + a dedicated server. If your application has occasionally slow + responses that are /not/ CPU-intensive, you may increase this to + workaround those inefficiencies. + +* worker_processes may be increased for Unicorn::OobGC users to provide + more consistent response times. + +* Never, ever, increase worker_processes to the point where the system + runs out of physical memory and hits swap. Production servers should + never see heavy swap activity. + * Setting a very low value for the :backlog parameter in "listen" directives can allow failover to happen more quickly if your cluster is configured for it. @@ -42,11 +61,6 @@ See Unicorn::Configurator for details on the config file format. have them unbuffered (File#sync = true) or they are record(line)-buffered in userspace before any writes. -* worker_processes should be scaled to the number of processes your - backend system(s) can support. DO NOT scale it to the number of - external network clients your application expects to be serving. - Unicorn is NOT for serving slow clients, that is the job of nginx. - == Kernel Parameters (Linux sysctl) WARNING: Do not change system parameters unless you know what you're doing! |