[jifty-devel] MySQL: Transparent reconnect

Jesse Vincent jesse at bestpractical.com
Wed Sep 6 00:24:26 EDT 2006

On Tue, Sep 05, 2006 at 10:31:35AM +0200, Thomas Themel wrote:
> Hi,
> my Jifty web application has now been deployed, and because it's a small
> application used infrequently by only a few people, I get a lot of MySQL
> timeouts. Jifty reacts to this by logging 
> [Tue Sep 05 10:18:29 2006] [error] [client] FastCGI:
> server "/home/www/ql.themel.com/bin/jifty" stderr: DBD::mysql::st execute 
> failed: MySQL server has gone away at 
> /usr/local/share/perl/5.8.4/Jifty/DBI/Handle.pm line 468.

Are you using FastCGI or jifty in standalone mode? If the latter, I
think the problem is that HTTP::Server::Simple::CGI doesn't set
GATEWAY_INTERFACE, so the clever magic you describe never kicks in. 

> DBD::mysql actually has a transparent reconnect feature that it disables
> by default, unless the environment variables MOD_PERL or
> GATEWAY_INTERFACE are set. It can be turned on by setting
> $db->{mysql_auto_reconnect} = 1 ; It would be really useful for me to
> have this in Jifty. After a quick look at the source, I didn't see an
> obvious hook to change the initialization of Jifty::DBI::Handle::mysql
> objects, and so I thought I'd ask whether
> - Jifty should set GATEWAY_INTERFACE, at least in fastcgi mode?

In FastCGI mode, the CGI engine should do this. What webserver are you
running on?


> - it would be a good idea to add handle-specific connect or new methods?
> ciao,
> -- 
> [*Thomas  Themel*] I just want an EDitor!! Not a "viitor". Not a "emacsitor".
> [extended contact] Those aren't even WORDS!!!! ED! ED! ED IS THE STANDARD!!!
> [info provided in]
> [*message header*] Paul J. LoPresti in <1991Jul11.031731.9260 at athena.mit.edu>
> _______________________________________________
> jifty-devel mailing list
> jifty-devel at lists.jifty.org
> http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel


More information about the jifty-devel mailing list