On Thu, 14 Dec 2000, Tim Bunce wrote:

> On Thu, Dec 14, 2000 at 11:47:58AM +1100, Jie Gao wrote:
> > On Thu, 14 Dec 2000, Stas Bekman wrote:
> > 
> > > 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
> 
> Why is/was ping() infamous?

Something becomes infamous when it solves a big problem :) 

> > > 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.
> > 
> > Problem is it is not only relevant, but ping doesn't work in all cases.
> > I have to cron-kill/start my servers in the morning.

Yeah, it doesn't help if you don't mention what DBD you are talking about.
Jie, can you override the timeout setting for your server as in example
above?


_____________________________________________________________________
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