[Mongrel] Debugging high CPU with Mongrel

kigsteronline at mac.com kigsteronline at mac.com
Wed Dec 6 17:44:53 EST 2006


Not sure I have an answer to your question, but we are running  
mongrel (x5) and apache 2.0 (mod_proxy_balancer) also separately from  
the database, on a single 2-CPU low-end server with about 30K page  
hits a day, with no caching at all, and the load on the box is nearly  
zero all the time.

I see that you are using pen which is a TCP based load balancer?    
Does it server your static files, or does mongrel do that?

If you are serving static files with mongrel I can see how you can be  
overloading your box so easily.   We have 40+ apache processes in  
front of mongrel which serve two purposes:

1. they serve static files very quickly and free up mongrel to only  
handle actual RoR actions
2. they push the data over the network, so that slow clients do not  
hold up scarce mongrel processes.

Also note that each apache process is abount 2-3Mb.  Our mongrel is  
about 80Mb in comparison. Again, it's a lot cheaper to server as much  
content as possible without hitting mongrel.

Hope this helps,
Konstantin



On Dec 6, 2006, at 1:56 PM, Dallas DeVries wrote:

> I'm running a site that gets ~30k to 40k page hits per day.  In the  
> last 4 days my mongrel processes have been jumping into high CPU  
> usage a couple of times a day to the point where my site becomes  
> unresponsive (database on a diff machine with no load).  The only  
> way for me to resolve the problem and reduce load on the machine is  
> to delete my rails cache directory (I have plenty of space and I'm  
> not hitting any filesystem limit in terms of # of files and  
> directories).  I initially thought it was the DOS vulnerability  
> posted a couple of days ago but I upgraded to ruby 1.8.5p2 with  
> mongrel 0.3.18 and we are still experiencing the same problem  
> multiple times a day.
>
> Is there some way to debug where in our application/rails/mongrel  
> the cpu is getting spiked from?  I'm just not sure how to proceed  
> further in debugging this.
>
> Pen
> Mongrel 0.3.18 ( 5 running )
> ruby 1.8.5p2
>
> Thanks,
> Dallas
>
>
>
> _______________________________________________
> Mongrel-users mailing list
> Mongrel-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-users



More information about the Mongrel-users mailing list