While we're on the topic
normalperson at yhbt.net
Fri Oct 9 19:26:32 EDT 2009
Brian Ketelsen <bketelsen at gmail.com> wrote:
> First - Thanks! We're loving Unicorn.
Hi Brian, thanks for the feedback!
> I'm serving about 200K API requests a day on a few linux servers running
> Unicorn. We have the API calls, and also some admin stuff that has a UI.
> I have a pair of F5 load balancers in front of the setup with two pools.
> The API pool passes directly to the unicorns, while the UI pool passes
> to nginx which passes to unicorn. At the time it seemed to make sense
> that the API calls were stateless and waiting only on our backend
> services to process. The UI was a more complex story with web browsers
> and persistence.
> I'm curious -- is the F5 straight to unicorn plan a good one? We've had
> no complaints from our customers and great performance, so it's more of a
> rhetorical question, my average API response time is a tenth of a second.
> Are there any traps here?
It depends heavily on several factors:
* Responses sizes, are they smaller than the outgoing network buffers?
As long as Unicorn can write to their outgoing network buffers
without the receiving end (the F5) blocking it, the response should
be fine since it's basically fire-and-forget.
* Do you handle large requests? This is the troublesome part with
non-nginx frontends... I think the F5 can buffer headers entirely
before sending them on if it's told to do layer 7, but it never
buffers request bodies. That said I've never been able to study
F5s (or any non-Free frontends) in depth...
* Do your clients want/need/benefit from HTTP keepalive and pipelining?
I'm not sure if the F5 is capable of mapping keepalive/pipelining
from the client to the non-keepalive Unicorn backends.
More information about the mongrel-unicorn