Topic: Mongrel slows down after a while

We have a new rails app that we have deployed for a few people to look at. When I say few people, I mean 5-10 users. There are at most 3-4 users accessing the app at any point of time. I have configured Apache in front of Mongrel with the help of URL redirection and proxy. When I start Mongrel the application is reasonably fast. But after sometime - say 6-8 hours, the application starts to crawl. And it keeps crawling till I stop and start Mongrel again. It's worth mentioning that I'm running Mongrel in the development environment. I'm not a rails expert. Can someone please help!!!

Thanks
Neel

Re: Mongrel slows down after a while

can you post what the response time is from development.log?  The lines that look like:

Parameters: {"action"=>"index", "controller"=>"landings"}
Rendering template within layouts/landings
Rendering landings/index
Rendered landings/_search (0.00077)
Rendered layouts/_ga (0.00016)
Completed in 0.00642 (155 reqs/sec) | Rendering: 0.00312 (48%) | DB: 0.00000 (0%) | 200 OK

Re: Mongrel slows down after a while

Hi,

Here's a part of the log:

Rendering layoutfalse within layouts/popup
Rendering post/show_post_form
Rendered /shared/_micro_control (0.00116)
Completed in 0.05006 (19 reqs/sec) | Rendering: 0.01739 (34%) | DB: 0.00770 (15%) | 200 OK [http://lab4.globallogic.com/post/show_post_form]

Processing PostController#show_post_form (for 172.16.57.52 at 2008-04-02 14:36:27) [POST]
  Session ID: fdaa2953f71fbb39af36573cbb6f018b
  Parameters: {"action"=>"show_post_form", "controller"=>"post", "slider_id"=>"post_slider_control"}
...
...
Rendered /shared/_micro_control (0.00116)
Completed in 0.05006 (19 reqs/sec) | Rendering: 0.01739 (34%) | DB: 0.00770 (15%) | 200 OK [http://lab4.globallogic.com/post/show_post_form]


Rendered /project/_events_widget (0.04839)
Rendered /shared/_collection_social_pane (0.00019)
Completed in 0.21022 (4 reqs/sec) | Rendering: 0.07657 (36%) | DB: 0.05850 (27%) | 200 OK [http://lab4.globallogic.com/personal/au … h_personal]

The responses look ok, they're well under one second. But when mongrel starts crawling, and I tail the log, the log gets written very slowly. Say when I click the "login" button, say there are 5 requests that are fired (login, display main page, run auto-refresh etc. etc.) . I see that there is a huge gap between each of the requests being written onto the logs. There is also a memory build up as time passes.

Last edited by xantham (2008-04-03 10:29:38)

Re: Mongrel slows down after a while

you're probably over your memory and swapping is my guess.  can you type this:  "free -m" and paste what you get when you first start mongrel and also when it starts slowing down?