Setting timeout to avoid bug in MySQL driver that causes Mongrel stopping to work after a long idle time
|Assignee:||Jean-Philippe Lang||% Done:|
|Resolution:||Wont fix||Affected version:||0.8.4|
Mongrel stop working after a long idle time because of bug in MySQL driver that doesn't properly timeout connections. What happens is the MySQL server side of the connection times out and closes, but the MySQL client doesn't detect this and just sits there. As a result Mongrel stops responing until its restart.
The problem is discussed here:
What is necessary to do is to set:
ActiveRecord::Base.verification_timeout = 14400
Or to any value that is lower than the MySQL server's interactive_timeout setting. This will make sure that ActiveRecord checks the connection often enough to reset the connection.
I don't know Ruby. Is there any way to patch this myself or shall I wait for the future Redmine release?
#4 Updated by Vadim Epstein about 12 years ago
- Assignee set to Jean-Philippe Lang
Who can assist with this then? Mongrel freezes and the problem is not solved. In fact I don't know the actual reason for 100%. But Mongrel keeps freezing.
Please advise where and who I can address this issue to.
#5 Updated by K Purohit about 12 years ago
I had the same issue. I think the problem was that we were running Ruby v.1.8.5 and didn't have the mysql gem installed. This gem needs Ruby v.1.8.6 or above.
How I solved it (on a RHEL5 box) was to update Ruby to 1.8.6 using this repository (you can also compile it yourself; I was being hasty!)
Then install the mysql-devel RPM. Now you're ready to install the mysql gem (gem install mysql)
Hopefully, this does the trick. You can also use
irb and type:
If that doesn't throw any errors, I think you're set after restarting mongrel.
Hope this helps. If there were any errors in my understanding, it's probably because I'm new to the whole Rails thing :)
#6 Updated by Vadim Epstein about 12 years ago
The following workaround was found.
Script has been configured to access list of projects page every 3 minutes.
As far as I understand this forces mogrel to keep mysql connection up and thus redmine works.
Anyway this problem should be fixed in future versions of redmine