thread_timeout: document additional caveats
[rainbows.git] / TUNING
bloba4d2498a82437ff6db74f9f28beaae27f7f5757b
1 = Tuning \Rainbows!
3 Most of the {tuning notes}[http://unicorn.bogomips.org/TUNING.html]
4 apply to \Rainbows! as well.  \Rainbows! is not particularly optimized
5 at the moment and is designed for applications that spend large amounts
6 of the time waiting on network activity.  Thus memory usage and memory
7 bandwidth for keeping connections open are often limiting factors as
8 well.
10 As of October 2009, absolutely ZERO work has been done for performance
11 validation and tuning.  Furthermore, \Rainbows! is NOT expected to do well on
12 traditional benchmarks.  Remember that \Rainbows! is only designed for
13 applications that sleep and/or trickle network traffic.  In the future,
14 *may* do well in traditional benchmarks as a side effect, but that will
15 never be the primary goal of the project.
17 == \Rainbows! configuration
19 * Don't set +worker_connections+ too high.  It is often better to start
20   denying requests and only serve the clients you can than to be
21   completely bogged down and be unusable for everybody.
23 * Increase +worker_processes+ if you have resources (RAM/DB connections)
24   available.  Additional worker processes can better utilize SMP, are more
25   robust against crashes and are more likely to be fairly scheduled by
26   the kernel.
28 * If your workers do not seem to be releasing memory to the OS after
29   traffic spikes, consider the {mall}[http://bogomips.org/mall/] library
30   which allows access to the mallopt(3) function from Ruby. As of
31   October 2009 tcmalloc (the default allocator for Ruby Enterprise
32   Edition) does not release memory back to the kernel, the best it can
33   do is use madvise(2) in an effort to swap out unused pages.
35 == nginx configuration
37 If you intend to use nginx as a reverse-proxy in front of \Rainbows!  to
38 handle Comet applications, make sure you disable proxy response
39 buffering in nginx:
41   proxy_buffering off;
43 This can be disabled on a per-backend basis in nginx, so under no
44 circumstances should you disable response buffering to Unicorn
45 backends, only to \Rainbows! backends.