[Mongrel] Memory leaks in my site

Zed A. Shaw zedshaw at zedshaw.com
Wed Mar 7 14:02:07 EST 2007


On Wed, 7 Mar 2007 13:06:17 +0800
"Ken Wei" <2828628 at gmail.com> wrote:

> I created a new rails app named 'test' which containing only a controller
> and an action .
> Here is the controller:
> 
> class MyTestController < ApplicationController
> 
>         def index
>                 render_text 'Hello!'
>         end
> 
> end

Yes, *this* is the test case you use.
 
> I keeped the setup as the same as before. Then i ran a single mongrel server
> which listening on 3000 by default, and used httperf to hit the action:
> 
> httperf --server 192.168.1.1 --port 3000 --rate 80 --uri /my_test --num-call
> 1 --num-conn 10000

The --num-call parameter is useless, and a rate of 80 isn't good
either.  How did you come up with this rating?

Start with --num-conn 1000, and see what the estimated rate is, then
give it that rate.  After that, slowly move --rate up or down until you
find the point where you can't make it any faster without the speed
dropping.

And, go get http://peepcode.com/products/benchmarking-with-httperf so I
don't have to try to explain it over email.

> The memory usage of the mongrel server grows from 20M to 144M in 20 seconds,
> it's crazy!

Well, there's enough people complaining about memory leaks in *MONGREL*
when they run *RAILS* that I'll have to investigate it.

> And i tryed Lighttpd + FastCGI to test this case, it works well. Then i
> think about if i need to roll back to the fastcgi way? is the mongrel the
> future of the rails community?

FastCGI forces a garbage collection after a certain number of requests,
but if your app runs with FastCGI then you should use that.  Don't use
a solution that doesn't work.

-- 
Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu
http://www.zedshaw.com/
http://www.awprofessional.com/title/0321483502 -- The Mongrel Book
http://mongrel.rubyforge.org/


More information about the Mongrel-users mailing list