This forum is no longer active. Please post your questions to our new community site

Mongel Cluster crashes after period of inactivity - Production

Subscribe to Mongel Cluster crashes after period of inactivity - Production 10 post(s), 5 voice(s)

Avatar Leigh 4 post(s)

Hi, I have my production RubyStack up and running (Windows). Have 4 Mongrel Cluster. All works flawlessly until I pop off to bedforshire, wake up in the morning, and all 4 mongrels have crashed.
Segmentation fault, which appears to be related to MySql. I am guessing it is a connection timeout issue?
Has anyone else come across this? Is there a trick / gem I need which will ensure the connections to MySql keep alive or are re-made correctly?

The error reported is at line 548 of the mysql_adapter.rb file which is


Any help would be much appreciated. Following months of testing and bug fixing it is soul destroying to find the production stack is our problem! (and I apprecaite this is probably not a BitNami issue, more likely just Ruby / MySQL / Mongrel) Thanks in advance.

Avatar Leigh 4 post(s)

Anyone have a feeling as to whether adding this into the bottom of environment.rb will work?

ActiveRecord::Base.connection.instance_eval {@connection.reconnect = true}

(I am testing it, but need to wait for a long period of inactivity)

Avatar Beltrán Rueda Administrator 3,714 post(s)

Hi Leigh,

We have some RubyStack in production (but running on Linux platforms) and we have not experienced this issue.

Avatar Leigh 4 post(s)

Thanks Beltran.

Have also seen suggestion of adding

SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1

to Apache Virtual Host setting, so also trying that…

Avatar Leigh 4 post(s)

And finally have configured the MySQL wait_timeout parameter to something more than the default (which is about 8 hours and ties up closely with what I have observed the timeout to be)

Avatar drhertel 2 post(s)

Any luck yet? I am getting this same error on line 548 in a Rails app I wrote that does not use RubyStack. It happens on both Windows/webbrick and Linux/Mongrel.

Avatar GarthS 1 post

Had the same problem. We were able to reproduce at will with a short wait_timeout. Installed this patch and it appears to be fine now:

Avatar drhertel 2 post(s)

The patch worked for me too. Thanks a bunch!

Avatar JieDai 1 post

I am newbie on RubyStack. Have a similar problem seems caused by the Mysql timeout which killed my mongrel server (mysql server is not on the liocal machine as webserver and rails application) I wonder whether anyone can give instructions on how to add and use the patch? Thanks!

Avatar Beltrán Rueda Administrator 3,714 post(s)


You can modify the files directly or you can download the new version of the file and copy in the correct location.