Mongrel freeze


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/
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.


I am also have problems with mongrel freezing.

  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.