View Full Version : Mysql connections dropping
kontrabass
Thu 22nd Feb '07, 12:38pm
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
Scott MacVicar
Thu 22nd Feb '07, 12:51pm
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.
kontrabass
Thu 22nd Feb '07, 12:55pm
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)
Steve Machol
Thu 22nd Feb '07, 1:02pm
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
Scott MacVicar
Thu 22nd Feb '07, 2:00pm
That query doesn't look particularly bad, I certainly dont see it taking a long time to run
kontrabass
Thu 22nd Feb '07, 5:36pm
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.
jason|xoxide
Thu 22nd Feb '07, 7:43pm
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.
kontrabass
Thu 22nd Feb '07, 7:58pm
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.
eva2000
Fri 23rd Feb '07, 6:52am
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 ?
kontrabass
Mon 26th Feb '07, 5:13pm
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 :)
kerplunk
Mon 26th Feb '07, 7:28pm
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.
Marco van Herwaarden
Wed 28th Feb '07, 8:53am
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.
vBulletin® v3.8.0 Release Candidate 1, Copyright ©2000-2008, Jelsoft Enterprises Ltd.