"MySQL server has gone away" with Apache 2.2 + Mongrel cluster

Hi

I just setup a server (Apache 2.2, mod_proxy_balancer, mongrel_cluster) with 2 Rails applications according to this excellent Post: http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you

Everythings works great, but after a long inactive period (say one night), the first 3 connections allways get an Error 500

Excerpt from production.log: … Rendering authentication/login Completed in 0.00301 (332 reqs/sec) | Rendering: 0.00279 (92%) | DB: 0.00000 (0%) | 200 OK [[

http://myapp/authentication/login ](http://myapp/authentication/login)] Mysql::Error: MySQL server has gone away: SELECT * FROM sessions WHERE (session_id = '875b6a6dff4de7e8bb2f7709cf9c31

db’) LIMIT 1 …

Note: the mongrel cluster is configured to have 3 mongrel processes. Is this a clue why only the first 3 connections allways get the error ?

Thanks for your input.

what version of MySQL are you running?

ed

On Debian Sarge: dpkg --list | grep mysql ii libdbd-mysql-p 2.9006-1 A Perl5 database interface to the MySQL data ii libmysqlclient 3.23.56-3 LGPL-licensed client library for MySQL datab ii libmysqlclient 3.23.56-3 LGPL-licensed client development files for M ii libmysqlclient 4.0.24-10sarge mysql database client library ii libmysqlclient 4.1.11a-4sarge mysql database client library ii mysql-client-4 4.1.11a-4sarge mysql database client binaries ii mysql-common-4 4.1.11a-4sarge mysql database common files (e.g. /etc/mysql ii mysql-server-4 4.1.11a-4sarge mysql database server binaries

Everythings works great, but after a long inactive period (say one night), the first 3 connections allways get an Error 500

Did you "gem install mysql" the latest version of the mysql gem? That always seems to clear up my mysql issues.

I dont know what the latest mysql gem version is. However, gem list --local shows mysql (2.7)