# Mongrel freeze

**URL:** <https://www.ruby-forum.com/t/mongrel-freeze/143297>\
**Category:** Rails\
**Created:** [July 17, 2008, 2:51am UTC](https://www.ruby-forum.com/t/mongrel-freeze/143297 "2008-07-17T02:51:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![billv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bb73d2/32.png) [@billv](https://www.ruby-forum.com/u/billv)\
**Post date:** [July 17, 2008, 2:51am UTC](https://www.ruby-forum.com/t/mongrel-freeze/143297/1 "2008-07-17T02:51:13Z")

</div>

Hi,

I am having a problem with mongrel not responding after a period of  
inactivity. Searching the various logs and such, it seems to be a  
problem with mysql. The facts:

- I am running CentOS5
- I do not have a warning about using the non-production mysql driver  
at the top of my log, so I presume I am using the C version from the  
gem install.
- I added this statement to my production.rb file located at config/  
environments:  
ActiveRecord::Base.verification\_timeout = 30  
In fact, I tried this first at 14400 as suggested in the Mongrel FAQ,  
to no better result.
- I set the wait\_timeout mysql variable to 604000 using set global  
wait\_timeout = 604000. This value sticks when set.
- I set the wait\_timeout mysql variable to 604000 using set  
wait\_timeout = 604000. This value sticks only as long as my mysql  
session is open. Show variables like “wait\_timeout” yields 604000.  
However, when I close that session and go back in, the value is back  
to 28800.

When the problem occurs, the production.log shows “Broken Pipe”.

Restarting mongrel fixes it.

I presume the wait\_timeout variable is to blame. The mysql  
documentation says it will get it’s value from the global wait\_timeout  
setting, but that is not happening.

I also tried setting the interactive\_timeout, but that had no impact.

Thanks.

---

<div class="post-metadata">

**Author:** ![billv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bb73d2/32.png) [@billv](https://www.ruby-forum.com/u/billv)\
**Post date:** [July 27, 2008, 7:25pm UTC](https://www.ruby-forum.com/t/mongrel-freeze/143297/2 "2008-07-27T19:25:49Z")

</div>

I am also have problems with mongrel freezing.

Environment:  
Debian on 2.6.25-2-486  
Rails 2.1.0  
Mongrel 1.1.5

I have 2 rails sites running on this box, both with 1 mongrel each. The  
first does not use ActiveRecord at all and has no problems.

The 2nd one freeze are a few hours period of inactivity. It is also  
heavily using send\_file() to send files between 1MB to 5MB. I am not  
sure if that has anything to do with it.

In the mongrel.log there is nothing reported after it freezes. It just  
shows the last request. In the rails log the same thing.

When I try to go to the site Firefox just sits there waiting and after a  
few minutes it just times out.

Thanks,  
John
