Forum: Ruby on Rails Re: ultramonkey vs pound?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
364025223fa593e2e76111b31d76f406?d=identicon&s=25 Piet Hadermann (piet)
on 2007-01-10 10:23
(Received via mailing list)
Raymond,

Also check out HAProxy at http://haproxy.1wt.eu/

I've been using it on 2 installations without any problems. Pound was
used before, but it was much more of a resource (cpu) hog, even when it
really didn't have to do any lb'ing.

One of these installations is a very minimal VPS based setup. A simple
fetch of the login page with ab (tested with 20 and 100 concurrent
connections) gave me about 13 req/sec with Pound, and about 19 with
HAProxy. Probably for a large part because Pound was sending requests to
the mongrels in a random way, while with HAProxy I opted for a 'round
robin' lb'ing. The latter gives better results when doing
one-after-the-other benchmarking using tools look ab.
Still, I believe a round robin style lb'ing is better suited to our
situation, also under normal conditions.

HAProxy also has the interesting option of limiting connections to the
back-end servers. Since mongrel can only handle 1 request at a time, I
figured if you limit connections in HAProxy to 1, then new requests will
get forwarded to the first non-busy mongrel at lb level instead of
queued up at mongrel itself.
Requests will get queued up at HAProxy and routed to the first free
mongrel, instead of routed right away to the 'next' mongrel and queued
at mongrel level, with the possibility that another mongrel is sitting
there idle. Checking this visually with top confirmed my assumption
(HAProxy: all mongrels busy, Pound: about 75% busy at full load)
Benchmarking this setup with ab dropped reqs/sec back to 13, but the
time/req dropped compared to Pound, and I *think* this will also result
in a more responsive webapp and the best configuration for our
(rails/mongrel) situation.

Also, big disadvantage about pound (at least when put behind apache, not
sure about other situations): when checking production.log all requests
seem to be coming from 127.0.0.1 (technically they are), while when
using HAProxy you get the actual ip address they're coming from. I
*believe* rails checks the 'X-Forwarded-For' http header and I don't
know the details but HAProxy handles this better than Pound for our
situation. (Pound probably puts it's own ip address in there when it
forwards a request while Pound leaves it as it is)

On the other hand, you can't say something as cool as "I'm pounding my
mongrels" when using HAProxy...

My 2 cent. Correct me if I'm wrong.

Piet.
This topic is locked and can not be replied to.