Mongrel - server pooping out

i am using the following comman to fire up mongrel:

[sergio@vb_workstation chatlogger]$ mongrel_rails start -d -p 8088
** You have sendfile installed, will use that to serve files.

and everything works fine until some point at night… i think it is
pooping out some time in the middle of the night… if i try to hit the
app in the morning, it just stalls out…

if i restart it, it’s fine the rest of the day…

anyone have any ideas?

thanks in advance…

  1. MySQL has a weird timeout mechanism requiring you to change the mysql
    server and activerecord timeouts. Search the mongrel list for e-mails
    on this.

AH…

i looked on your mailing list, and i found this:

Just raising the interactive_timeout doesn’t really solve the problem
(while it may appear to.) I would suggest setting the
verification_timeout for ActiveRecord. Set it lower than the
interactive_timeout in MySQL.

ActiveRecord::Base.verification_timeout = 14400

This will force Rails to reconnect to the database before MySQL can get
a chance to timeout.

my question is:

where do i put this line:

ActiveRecord::Base.verification_timeout = 14400

also, i checked my log, and found these:

Thread #<Thread:0xb78faf38 sleep> is too old, killing.
Thread #<Thread:0xb78fbc94 sleep> is too old, killing.
Thread #<Thread:0xb78fc838 sleep> is too old, killing.
Thread #<Thread:0xb78fd508 sleep> is too old, killing.
Thread #<Thread:0xb78febc4 sleep> is too old, killing.
Thread #<Thread:0xb78ffaec sleep> is too old, killing.
Thread #<Thread:0xb792fddc sleep> is too old, killing.

On Wed, 2006-07-05 at 04:54 +0200, sergio ruiz wrote:

anyone have any ideas?

It could be one of three possible things that seem to bite people after
long times of inactivity:

  1. MySQL has a weird timeout mechanism requiring you to change the mysql
    server and activerecord timeouts. Search the mongrel list for e-mails
    on this.
  2. Another server has an inactivity timeout which is killing you.
  3. Some folks are finding that their log rotation scripts kills rails if
    they rotate the rails log files. Not sure why this happens just yet.

Check for each of this, but I’m betting it’s #1. Let me know if when
you shutdown the server you see lots of “killing old thread” messages in
the mongrel.log


Zed A. Shaw

http://mongrel.rubyforge.org/
http://www.railsmachine.com/ – Need Mongrel support?

ActiveRecord::Base.verification_timeout = 14400

found it:

config/environments.rb

i put it in there…

let’s see what happens…