1 = \Rainbows! is like unicorn, but Different...
3 While \Rainbows! depends on unicorn for its process/socket management,
4 HTTP parser and configuration language; \Rainbows! is more ambitious.
6 == Architectural Diagrams
8 === unicorn uses a 1:1 mapping of processes to clients
21 === \Rainbows! uses a M:N mapping of processes to clients
51 In both cases, workers share common listen sockets with the master and
52 pull connections off the listen queue only if the worker has resources
55 == Differences from unicorn
57 * log rotation is handled immediately in \Rainbows! whereas unicorn has
58 the luxury of delaying it until the current request is finished
59 processing to prevent log entries for one request to be split across
62 * load balancing between workers is imperfect, certain worker processes
63 may be servicing more requests than others so it is important to not
64 set +worker_connections+ too high. unicorn worker processes can never
65 be servicing more than one request at once.
67 * speculative, non-blocking accept() is not used, this is to help
68 load balance between multiple worker processes.
70 * HTTP pipelining and keepalive may be used for GET and HEAD requests.
72 * Less heavily-tested and inherently more complex.
75 == Similarities with unicorn
77 While some similarities are obvious (we depend on and subclass off
78 unicorn code), some things are not:
80 * Does not attempt to accept() connections when pre-configured limits
81 are hit (+worker_connections+). This will first help balance load
82 to different worker processes, and if your listen() +:backlog+ is
83 overflowing: to other machines in your cluster.
85 * Accepts the same {signals}[http://unicorn.bogomips.org/SIGNALS.html]
86 for process management, so you can share scripts to manage them (and
89 * supports per-process listeners, allowing an external load balancer
90 like haproxy or nginx to be used to balance between multiple
93 * Exposes a streaming "rack.input" to the Rack application that reads
94 data off the socket as the application reads it (while retaining
95 rewindable semantics as required by Rack). This allows Rack-compliant
96 apps/middleware to implement things such as real-time upload progress