Mysql connections dropping

  • I'm getting an average of 2-3 "lost connection to mysql during query" errors per day now. And I can't figure this out: My wait_timeout is set to 35 seconds. My slow-query-log is set to 10 seconds, and when I get one of these errors, nothing shows up in the slow query log. I thought it would, if the connection is being dropped because of the 35 second wait_timeout? Hmm.

    Max packet is set to 64M, and I don't seem to be coming close to my max_connections limit (set to 800).

    Is there some other cause to these dropped queries? I'm on a dual server setup.

    Thanks!

    If this is of any use: Most of the errors seem to be this query:

    DELETE FROM subscribethread WHERE threadid = 310982 AND userid = 82389;

    MySQL Error : Lost connection to MySQL server during query Error Number : 2013
    Date : Thursday, February 22nd 2007 @ 10:43:48 AM
    Script : http://www.talkbass.com/forum/newreply.php?do=postreply&t=310982
    Referrer : http://www.talkbass.com/forum/newreply.php?do=newreply&noquote=1&p=3853022


  • This is a server issue. You need to contact your host about this. See this post for the possible causes of a lost connection error:

    http://www.vbulletin.com/forum/showthread.php?s=&postid=310265#post310265


  • lost connections error remedies usually are to raise the wait_timeout ... so try 60 or 90 seconds and see how it goes

    what you're current php and mysql and vB versions ?

    Thanks Eva, I got edumacated on the wait_timeout and changed it back to the mysql default. Seems to be fine now :)


  • lost connections error remedies usually are to raise the wait_timeout ... so try 60 or 90 seconds and see how it goes

    what you're current php and mysql and vB versions ?


  • That query doesn't look particularly bad, I certainly dont see it taking a long time to run

    Thanks, I'll tell my host this. Something is certainly up, just got a flood of 28 such errors in 1 minute this afternoon.


  • 35 for wait_timeout is pretty low. I generally start my sites at 60 and move up by 30 at a time until those go away.


  • Depends what the query was, if its a shutdown query then its possible it took ages to deliver the page and the query running after every was downloaded was too late.

    We fixed the problem in the vBulletin members area by running some queries before files were downloaded.


  • Some queries in vBulletin are scheduled to run once the page is fully loaded (ie. moved to the end of the SQL-queue). Depending on the page and the server load, these queries might be executed longer then 10 seconds after the previous request.


  • 35 for wait_timeout is pretty low. I generally start my sites at 60 and move up by 30 at a time until those go away.


    I'm curious though - who would wait more than 35 seconds for a page to load? Isn't it better to just kill off such requests? I may be missing the concept behind the wait_timeout because it seems like such requests would end up in the slow_query log (none do).

    My host looked at all the mysql stats and vars, and wasn't able to come up with anything, as I'm already pretty much optimized by Eva2000....

    I could set the wait_timeout higher, but I wonder if that wouldn't just be hiding a symptom. I emailed the users that were quoted in the vbulletin errors, and they say that they all got a blank page in their browser when they hit "post reply"... This happened to 28 users between 3:07pm and 3:08pm today.


  • Sorry I think my edit above came in as you were posting :)

    queries are mostly this:

    DELETE FROM subscribethread WHERE threadid = 310982 AND userid = 82389;

    MySQL Error : Lost connection to MySQL server during query Error Number : 2013
    Date : Thursday, February 22nd 2007 @ 10:43:48 AM
    Script : http://www.talkbass.com/forum/newrep...reply&t=310982 (http://www.talkbass.com/forum/newreply.php?do=postreply&t=310982)
    Referrer : http://www.talkbass.com/forum/newrep...te=1&p=3853022 (http://www.talkbass.com/forum/newreply.php?do=newreply&noquote=1&p=3853022)


  • That query doesn't look particularly bad, I certainly dont see it taking a long time to run


  • Queries shouldn't take longer than 10 seconds. If they do... yikes. Many large, high-traffic sites have their wait_timeout=10. (i.e. Slashdot and our site. ;))

    Follow George's advice and try 60 or 90.







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Mysql connections dropping , Please add it free.