I think that this item from the guide is not relevant anymore. Can I
kill it? 

=head3 The Morning Bug

Relational database server keeps a connection to the client open for a
limited period of time. Many developers were bitten by so called
B<Morning bug>, when every morning the first users to use the site
received a C<No Data Returned> message, but after that everything
worked fine. The error is caused by C<Apache::DBI> returning a handle
of the invalid connection (the server closed it because of a timeout),
and the script was dying on that error. The infamous C<ping()> method
was introduced to solve this problem, but still people were being
bitten by this problem. Another solution was found - to increase the
timeout parameter when starting the SQL server. Currently I startup
C<MySQL> server with a script C<safe_mysql>, so I have modified it to
use this option:

  nohup $ledir/mysqld [snipped other options] -O wait_timeout=172800


(172800 seconds is equal to 48 hours. This change solves the problem.)

Note that as from version C<0.82>, C<Apache::DBI> implements ping()
inside the C<eval> block.  This means that if the handle has timed out
it should be reconnected automatically, and avoid the morning bug.





_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://logilune.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/  


Reply via email to