# Apache 2.2 / mod\_proxy\_balancer... 160 req per second?

**URL:** <https://www.ruby-forum.com/t/apache-2-2-mod-proxy-balancer-160-req-per-second/126519>\
**Category:** Deployment\
**Created:** [January 18, 2008, 11:16pm UTC](https://www.ruby-forum.com/t/apache-2-2-mod-proxy-balancer-160-req-per-second/126519 "2008-01-18T23:16:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeffct](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/5f8ce5/32.png) [@jeffct](https://www.ruby-forum.com/u/jeffct)\
**Post date:** [January 18, 2008, 11:16pm UTC](https://www.ruby-forum.com/t/apache-2-2-mod-proxy-balancer-160-req-per-second/126519/1 "2008-01-18T23:16:42Z")

</div>

I’m testing a deployment on a dedicated server (dual core AMD with  
about 2GB ram, 100Mbps uplink) with Apache 2.2.3 (CentOS 5 build from  
yum), mod proxy balancer, and mongrel.

I can get Apache to serve static files at around 1200 requests per  
second, which I am happy with. However I can’t get dynamic pages  
(hello world controller through mongrel) to go more than 160 req per  
second. One mongrel gives me about 90, then 2 or more is 160. So the  
benefits seem to max out at only 2 mongrels.

I’ve used all the different conf files out there (everyone’s seem to  
look completely different), but the result is basically the same.

I found this in the Mongrel docs:

"Jason Hoffman reports:

```
Apache's mod_proxy_balancer module is a fully blocking module and

```

with the default httpd.conf you’re going to max out in the 120-160  
requests/ second range on a decent box. You can tune up its proxying  
to about a 1000 req/sec. So yes the net result is that you can really  
only put a couple of mongrels behind apache’s proxy engine (about 2  
“hello world” rails mongrels)."

Can’t find any more documentation on the subject though. Any ideas?  
I’m aware of nginx and would love to test it out someday, but for now  
I’d like to know what apache is capable of. I’ve seen enough people  
recommending it to think that there must be a way to get better than  
160 requests per second.

Any ideas? Thanks

---

<div class="post-metadata">

**Author:** ![jeffct](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/5f8ce5/32.png) [@jeffct](https://www.ruby-forum.com/u/jeffct)\
**Post date:** [January 18, 2008, 11:50pm UTC](https://www.ruby-forum.com/t/apache-2-2-mod-proxy-balancer-160-req-per-second/126519/2 "2008-01-18T23:50:50Z")

</div>

> ```
> Apache's mod_proxy_balancer module is a fully blocking module and
> 
> ```
> 
> with the default httpd.conf you’re going to max out in the 120-160  
> requests/ second range on a decent box. You can tune up its proxying  
> to about a 1000 req/sec. So yes the net result is that you can really  
> only put a couple of mongrels behind apache’s proxy engine (about 2  
> “hello world” rails mongrels)."

Hm, would that still be accurate if you set DEFAULT\_SERVER\_LIMIT to a  
higher  
value (from 256 up to 2048 or so) and then set MaxClients to that value?  
Wouldn’t that open things up a bit?

Yours,

Tom

---

<div class="post-metadata">

**Author:** ![jeffct](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/5f8ce5/32.png) [@jeffct](https://www.ruby-forum.com/u/jeffct)\
**Post date:** [January 19, 2008, 10:17am UTC](https://www.ruby-forum.com/t/apache-2-2-mod-proxy-balancer-160-req-per-second/126519/3 "2008-01-19T10:17:23Z")

</div>

But wouldn’t that setting also be affecting serving of static pages?  
Right now I am getting 5000-8000 requests per second locally or about  
1200 over the wire for static files through Apache.

I was able to get 185 requests per second out of Mongrel, but that is  
still a bit underwhelming. I spent a few hours today studying the  
Apache docs and settings for mod\_proxy and mod\_proxy\_balancer and  
testing different configs, but nothing made much difference.

Right now a single mongrel process (not behind Apache) is pushing  
90-100 requests per second with my real app (not just a hello world  
controller). So I am at a loss as to how the benefits are maxing out  
at 2 mongrels when behind Apache.

---

<div class="post-metadata">

**Author:** ![jeffct](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/5f8ce5/32.png) [@jeffct](https://www.ruby-forum.com/u/jeffct)\
**Post date:** [January 20, 2008, 3:21am UTC](https://www.ruby-forum.com/t/apache-2-2-mod-proxy-balancer-160-req-per-second/126519/4 "2008-01-20T03:21:48Z")

</div>

question from a beginner…  
i thought one can instantiate as many mongrels per ~60mb of memory  
installed?

---

<div class="post-metadata">

**Author:** ![jeffct](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/5f8ce5/32.png) [@jeffct](https://www.ruby-forum.com/u/jeffct)\
**Post date:** [January 20, 2008, 9:15pm UTC](https://www.ruby-forum.com/t/apache-2-2-mod-proxy-balancer-160-req-per-second/126519/5 "2008-01-20T21:15:57Z")

</div>

On Sat, 2008-01-19 at 01:16 -0800, Jeff wrote:

> But wouldn’t that setting also be affecting serving of static pages?  
> Right now I am getting 5000-8000 requests per second locally or about  
> 1200 over the wire for static files through Apache.

Yup, true, that would give you more static file capacity too.

> I was able to get 185 requests per second out of Mongrel, but that is  
> still a bit underwhelming. I spent a few hours today studying the  
> Apache docs and settings for mod\_proxy and mod\_proxy\_balancer and  
> testing different configs, but nothing made much difference.
> 
> Right now a single mongrel process (not behind Apache) is pushing  
> 90-100 requests per second with my real app (not just a hello world  
> controller). So I am at a loss as to how the benefits are maxing out  
> at 2 mongrels when behind Apache.

I’m probably not understanding… so right now you’re running Mongrel  
as both your web server and as your app container, is that right?

Yours,

Tom

---

<div class="post-metadata">

**Author:** ![jeffct](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/5f8ce5/32.png) [@jeffct](https://www.ruby-forum.com/u/jeffct)\
**Post date:** [January 25, 2008, 9:32pm UTC](https://www.ruby-forum.com/t/apache-2-2-mod-proxy-balancer-160-req-per-second/126519/6 "2008-01-25T21:32:37Z")

</div>

Here’s a wiki I wrote awhile ago for deploying a mongrel cluster.  
[http://pastie.caboo.se/143470](http://pastie.caboo.se/143470)

---

<div class="post-metadata">

**Author:** ![jeffct](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/5f8ce5/32.png) [@jeffct](https://www.ruby-forum.com/u/jeffct)\
**Post date:** [February 16, 2008, 5:43am UTC](https://www.ruby-forum.com/t/apache-2-2-mod-proxy-balancer-160-req-per-second/126519/7 "2008-02-16T05:43:50Z")

</div>

I was really confused about what “thin” you are talking about until I  
found  
[http://www.rubyinside.com/thin-a-ruby-http-daemon-thats-faster-than-mongrel-688.html](http://www.rubyinside.com/thin-a-ruby-http-daemon-thats-faster-than-mongrel-688.html)

aemadrid wrote:

> I would definitely give Thin a try. I got over 500 rps on a simple  
> hello world dynamic page.
> 
> AEM

---

<div class="post-metadata">

**Author:** ![jeffct](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/5f8ce5/32.png) [@jeffct](https://www.ruby-forum.com/u/jeffct)\
**Post date:** [January 26, 2008, 4:13am UTC](https://www.ruby-forum.com/t/apache-2-2-mod-proxy-balancer-160-req-per-second/126519/8 "2008-01-26T04:13:53Z")

</div>

I would definitely give Thin a try. I got over 500 rps on a simple  
hello world dynamic page.

AEM
