MyBB Community Forums

Full Version: Multiple MySQL error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I received the following error from the email error log sent by MyBB forum at the bottom. My host is hostgator and they replied the following:

Quote:It appears that your forums are having their mysql queries killed quite frequently by our systems. At the end of this email, I've attached the output from a quick search of the query log, which lists anything that had to be killed by our systems.

Please note that any query which runs longer than 15 seconds is terminated on our systems, to maintain stability for all users on the shared environment. You will want to look into possible updates for MyBB, and/or optimizing the site's code for a shared server environment.


=====
[root@ ~]# grep _mybb /var/log/mysql_queries.log
[ 1262517481 ] [ _mybb ] [ 6200518 ] [ 95 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ UPDATE mybb_spiders
[ 1271249101 ] [ _mybb ] [ 7640625 ] [ 66 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ UPDATE mybb_spiders
[ 1276608062 ] [ _mybb ] [ 3050692 ] [ 47 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ DELETE FROM mybb_sessions WHERE sid='bot=1' ]
[ 1276936202 ] [ _mybb ] [ 2455191 ] [ 32 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ REPLACE INTO mybb_sessions SET uid='0',sid='4f61b2e39f91a800dca94bf1092db63b',time='1276936170 ]
[ 1277064542 ] [ _mybb ] [ 3478378 ] [ 40 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ UPDATE mybb_spiders
[ 1278066961 ] [ _mybb ] [ 1359491 ] [ 82 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ UPDATE mybb_spiders
[ 1280359441 ] [ _mybb ] [ 4273828 ] [ 36 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ UPDATE mybb_sessions
[ 1280359441 ] [ _mybb ] [ 4273875 ] [ 27 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT * FROM mybb_sessions WHERE sid='0441a0264298d03731598b8124431c4c' AND ip='98.252.179.240' LIMIT 1 ]
[ 1281000256 ] [ _mybb ] [ 8755282 ] [ 16 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT title,cache FROM mybb_datacache ]
[ 1281103741 ] [ _mybb ] [ 9466923 ] [ 16 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT * FROM mybb_sessions WHERE sid='90222ec3652ed86ec4e2ecfd87514b77' AND ip='112.200.97.247' LIM ]
[ 1281105182 ] [ _mybb ] [ 9478068 ] [ 18 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT u.*, f.*
[ 1282109762 ] [ _mybb ] [ 16002757 ] [ 27 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT tid FROM mybb_threadsubscriptions WHERE tid='6' AND uid='0' LIMIT 1 ]
[ 1282117864 ] [ _mybb ] [ 16049989 ] [ 22 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT title,template FROM mybb_templates WHERE title IN ('' ,'index' ,'index_whosonline' ,'index_we ]
[ 1282117864 ] [ _mybb ] [ 16050111 ] [ 22 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT title,template FROM mybb_templates WHERE title IN ('' ,'index' ,'index_whosonline' ,'index_we ]
[ 1282155662 ] [ _mybb ] [ 16297606 ] [ 21 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ DELETE FROM mybb_sessions WHERE ip='202.156.10.242' ]
[ 1282155842 ] [ _mybb ] [ 16298408 ] [ 18 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT s.sid, s.ip, s.uid, s.time, s.location, s.location1, u.username, u.invisible, u.usergroup, u. ]
[ 1282187341 ] [ _mybb ] [ 43102 ] [ 30 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT s.sid, s.ip, s.uid, s.time, s.location, s.location1, u.username, u.invisible, u.usergroup, u. ]
[ 1282187341 ] [ _mybb ] [ 43140 ] [ 31 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT f.style, f.overridestyle, t.*
[ 1282203182 ] [ _mybb ] [ 126940 ] [ 21 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT * FROM mybb_sessions WHERE sid='8a352393eb2f77a19c858e6cb9a64274' AND ip='24.180.149.234' LIM ]
[ 1282213802 ] [ _mybb ] [ 183050 ] [ 52 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT * FROM mybb_threads WHERE tid='28' ]
[ 1282213802 ] [ _mybb ] [ 183074 ] [ 41 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ REPLACE INTO mybb_sessions SET uid='0',sid='ab009b464556a3d08d9d553df9a7df33',time='1282213726 ]
[ 1282213802 ] [ _mybb ] [ 183123 ] [ 61 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT * FROM mybb_sessions WHERE sid='39daad1c2ad09d5958f9052844564f97' AND ip='220.255.7.241' LIMI ]
[ 1282213981 ] [ _mybb ] [ 183423 ] [ 28 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT message, edittime, tid, fid FROM mybb_posts WHERE pid IN(381,311,289,279,226,222,206,180,152, ]
[ 1282213981 ] [ _mybb ] [ 183444 ] [ 38 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT * FROM mybb_threads WHERE tid='3' AND closed NOT LIKE 'moved|%' ]
[ 1282222443 ] [ _mybb ] [ 233155 ] [ 21 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT title,cache FROM mybb_datacache ]
[ 1283224141 ] [ _mybb ] [ 1730606 ] [ 27 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ DELETE FROM mybb_sessions WHERE ip='201.19.9.166' ]
[ 1283224682 ] [ _mybb ] [ 1733125 ] [ 17 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT u.*, f.*
[ 1283890681 ] [ _mybb ] [ 4486027 ] [ 19 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT pid FROM mybb_posts WHERE tid = '53' AND pid != '749' ORDER BY pid DESC ]
[ 1284739381 ] [ _mybb ] [ 950640 ] [ 55 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ CHECK TABLE mybb_adminlog ,mybb_adminoptions ,mybb_adminsessions ,mybb_adminviews ,mybb_announcement ]
[ 1285102982 ] [ _mybb ] [ 3190765 ] [ 129 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ CHECK TABLE mybb_adminlog ,mybb_adminoptions ,mybb_adminsessions ,mybb_adminviews ,mybb_announcement ]
[ 1285245182 ] [ _mybb ] [ 4620623 ] [ 95 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ REPLACE INTO mybb_sessions SET uid='0',sid='89e7c8e67a83635f918433f2428d3c8c',time='1285245086 ]
[ 1285245185 ] [ _mybb ] [ 4620690 ] [ 84 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT * FROM mybb_sessions WHERE sid='998511fd83a007214e0cfef3436d9371' AND ip='110.174.228.230' LI ]
[ 1285300981 ] [ _mybb ] [ 5236741 ] [ 21 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ UPDATE mybb_sessions
[ 1285349941 ] [ _mybb ] [ 5705767 ] [ 17 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT a.*, u.username
[ 1285737482 ] [ _mybb ] [ 9425047 ] [ 69 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ UPDATE mybb_sessions
[ 1285737482 ] [ _mybb ] [ 9425088 ] [ 62 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT * FROM mybb_sessions WHERE sid='867a652f7e1f664af065e99ba328cf33' AND ip='70.112.69.177' LIMI ]
[ 1285737482 ] [ _mybb ] [ 9425144 ] [ 49 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT * FROM mybb_sessions WHERE sid='867a652f7e1f664af065e99ba328cf33' AND ip='70.112.69.177' LIMI ]
[ 1285737482 ] [ _mybb ] [ 9425204 ] [ 34 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT * FROM mybb_sessions WHERE sid='d255f436b48d0fa5bbaa5595a37b579d' AND ip='98.127.25.10' LIMIT ]
[ 1285737482 ] [ _mybb ] [ 9425208 ] [ 34 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT * FROM mybb_sessions WHERE sid='d255f436b48d0fa5bbaa5595a37b579d' AND ip='98.127.25.10' LIMIT ]
[ 1285737482 ] [ _mybb ] [ 9425212 ] [ 33 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT * FROM mybb_sessions WHERE sid='d255f436b48d0fa5bbaa5595a37b579d' AND ip='98.127.25.10' LIMIT ]
[ 1285737482 ] [ _mybb ] [ 9425228 ] [ 28 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT * FROM mybb_sessions WHERE sid='867a652f7e1f664af065e99ba328cf33' AND ip='70.112.69.177' LIMI ]
[ 1285737482 ] [ _mybb ] [ 9425236 ] [ 26 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT * FROM mybb_sessions WHERE sid='b67df65c9828d2a371a5e4ec985a6bfb' AND ip='71.198.41.201' LIMI ]
[ 1285740901 ] [ _mybb ] [ 9449403 ] [ 25 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ UPDATE mybb_sessions
[ 1285740901 ] [ _mybb ] [ 9449406 ] [ 25 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT * FROM mybb_sessions WHERE sid='6872f3355275cd6d5f35740e393823df' AND ip='173.70.106.222' LIM ]
[ 1285740901 ] [ _mybb ] [ 9449411 ] [ 24 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT * FROM mybb_sessions WHERE sid='f25ce7a2ac6d4675edf9e78a9e18e293' AND ip='71.76.38.58' LIMIT ]
[ 1285740901 ] [ _mybb ] [ 9449423 ] [ 23 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT * FROM mybb_sessions WHERE sid='f25ce7a2ac6d4675edf9e78a9e18e293' AND ip='71.76.38.58' LIMIT ]
[ 1285740901 ] [ _mybb ] [ 9449426 ] [ 22 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT * FROM mybb_sessions WHERE sid='6872f3355275cd6d5f35740e393823df' AND ip='173.70.106.222' LIM ]
[ 1285740901 ] [ _mybb ] [ 9449429 ] [ 21 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT * FROM mybb_sessions WHERE sid='f25ce7a2ac6d4675edf9e78a9e18e293' AND ip='71.76.38.58' LIMIT ]
[ 1285740901 ] [ _mybb ] [ 9449430 ] [ 20 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT * FROM mybb_sessions WHERE sid='f25ce7a2ac6d4675edf9e78a9e18e293' AND ip='71.76.38.58' LIMIT ]
[ 1285740901 ] [ _mybb ] [ 9449433 ] [ 19 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT * FROM mybb_sessions WHERE sid='f25ce7a2ac6d4675edf9e78a9e18e293' AND ip='71.76.38.58' LIMIT ]
[ 1285740901 ] [ _mybb ] [ 9449437 ] [ 17 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT * FROM mybb_sessions WHERE sid='f25ce7a2ac6d4675edf9e78a9e18e293' AND ip='71.76.38.58' LIMIT ]
[ 1285740901 ] [ _mybb ] [ 9449452 ] [ 16 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT * FROM mybb_sessions WHERE sid='6872f3355275cd6d5f35740e393823df' AND ip='173.70.106.222' LIM ]
[ 1285742701 ] [ _mybb ] [ 9463428 ] [ 52 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ UPDATE mybb_sessions
[ 1285742701 ] [ _mybb ] [ 9463491 ] [ 44 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT * FROM mybb_sessions WHERE sid='6872f3355275cd6d5f35740e393823df' AND ip='173.70.106.222' LIM ]
[ 1285742701 ] [ _mybb ] [ 9463534 ] [ 33 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT * FROM mybb_sessions WHERE sid='6872f3355275cd6d5f35740e393823df' AND ip='173.70.106.222' LIM ]
[ 1285742701 ] [ _mybb ] [ 9463611 ] [ 16 ] [ _mybb ] [ Query ] [ KILLED ] [ '.hostgator.com' ] [ SELECT * FROM mybb_sessions WHERE sid='a41e61ef410c2a0ed30f3d7e91e0d336' AND ip='213.23.84.215' LIMI ]
=====


Quote:Details of the error include:
---
Type: 20
File: (Line no. 0)
Message
SQL Error: 1317 - Query execution was interrupted
Query:
UPDATE mybb_sessions
SET uid='223', time='1285737419', location='/showthread.php?tid=128', useragent='Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472', location1='3', location2='128', nopermission='0' WHERE sid='867a652f7e1f664af065e99ba328cf33' LIMIT 1

Details of the error include:
---
Type: 20
File: (Line no. 0)
Message
SQL Error: 1317 - Query execution was interrupted
Query: SELECT * FROM mybb_threads WHERE tid='18'

Details of the error include:
---
Type: 20
File: (Line no. 0)
Message
SQL Error: 2013 - Lost connection to MySQL server during query
Query: SELECT name, tid, properties, stylesheets FROM mybb_themes WHERE def='1' LIMIT 1

Details of the error include:
---
Type: 20
File: (Line no. 0)
Message
SQL Error: 1317 - Query execution was interrupted
Query:
SELECT u.*, f.*
FROM mybb_users u
LEFT JOIN mybb_userfields f ON (f.ufid=u.uid)
WHERE u.uid='223'
LIMIT 1

Details of the error include:
---
Type: 20
File: (Line no. 0)
Message
SQL Error: 2013 - Lost connection to MySQL server during query
Query:
SELECT f.style, f.overridestyle, t.*
FROM mybb_forums f
LEFT JOIN mybb_threads t ON (f.fid=t.fid)
WHERE t.tid='18'
LIMIT 1

Details of the error include:
---
Type: 20
File: (Line no. 0)
Message
SQL Error: 2013 - Lost connection to MySQL server during query
Query:
SELECT f.style, f.overridestyle, t.*
FROM mybb_forums f
LEFT JOIN mybb_threads t ON (f.fid=t.fid)
WHERE t.tid='18'
LIMIT 1

Details of the error include:
---
Type: 20
File: (Line no. 0)
Message
SQL Error: 1317 - Query execution was interrupted
Query:
SELECT u.*, f.*
FROM mybb_users u
LEFT JOIN mybb_userfields f ON (f.ufid=u.uid)
WHERE u.uid='257'
LIMIT 1

Details of the error include:
---
Type: 20
File: (Line no. 0)
Message
SQL Error: 2013 - Lost connection to MySQL server during query
Query:
SELECT f.style, f.overridestyle, t.*
FROM mybb_forums f
LEFT JOIN mybb_threads t ON (f.fid=t.fid)
WHERE t.tid='128'
LIMIT 1

Details of the error include:
---
Type: 20
File: (Line no. 0)
Message
SQL Error: 2006 - MySQL server has gone away
Query:
SELECT f.style, f.overridestyle, t.*
FROM mybb_forums f
LEFT JOIN mybb_threads t ON (f.fid=t.fid)
WHERE t.tid='103'
LIMIT 1

Details of the error include:
---
Type: 20
File: (Line no. 0)
Message
SQL Error: 1317 - Query execution was interrupted
Query: SELECT * FROM mybb_sessions WHERE sid='6872f3355275cd6d5f35740e393823df' AND ip='173.70.106.222' LIMIT 1

Details of the error include:
---
Type: 20
File: (Line no. 0)
Message
SQL Error: 1317 - Query execution was interrupted
Query: SELECT * FROM mybb_sessions WHERE sid='6872f3355275cd6d5f35740e393823df' AND ip='173.70.106.222' LIMIT 1

Details of the error include:
---
Type: 20
File: (Line no. 0)
Message
SQL Error: 1317 - Query execution was interrupted
Query: SELECT * FROM mybb_sessions WHERE sid='a41e61ef410c2a0ed30f3d7e91e0d336' AND ip='213.23.84.215' LIMIT 1

Details of the error include:
---
Type: 20
File: (Line no. 0)
Message
SQL Error: 2006 - MySQL server has gone away
Query:
SELECT f.style, f.overridestyle, t.*
FROM mybb_forums f
LEFT JOIN mybb_threads t ON (f.fid=t.fid)
WHERE t.tid='67'
LIMIT 1

Details of the error include:
---
Type: 20
File: (Line no. 0)
Message
SQL Error: 1317 - Query execution was interrupted
Query: SELECT * FROM mybb_sessions WHERE sid='f25ce7a2ac6d4675edf9e78a9e18e293' AND ip='71.76.38.58' LIMIT 1

Details of the error include:
---
Type: 20
File: (Line no. 0)
Message
SQL Error: 1317 - Query execution was interrupted
Query: SELECT * FROM mybb_sessions WHERE sid='6872f3355275cd6d5f35740e393823df' AND ip='173.70.106.222' LIMIT 1

Details of the error include:
---
Type: 20
File: (Line no. 0)
Message
SQL Error: 1317 - Query execution was interrupted
Query: SELECT * FROM mybb_sessions WHERE sid='f25ce7a2ac6d4675edf9e78a9e18e293' AND ip='71.76.38.58' LIMIT 1

Details of the error include:
---
Type: 20
File: (Line no. 0)
Message
SQL Error: 1317 - Query execution was interrupted
Query: SELECT * FROM mybb_sessions WHERE sid='f25ce7a2ac6d4675edf9e78a9e18e293' AND ip='71.76.38.58' LIMIT 1

Details of the error include:
---
Type: 20
File: (Line no. 0)
Message
SQL Error: 1317 - Query execution was interrupted
Query: SELECT * FROM mybb_sessions WHERE sid='f25ce7a2ac6d4675edf9e78a9e18e293' AND ip='71.76.38.58' LIMIT 1

Details of the error include:
---
Type: 20
File: (Line no. 0)
Message
SQL Error: 1317 - Query execution was interrupted
Query: SELECT * FROM mybb_sessions WHERE sid='f25ce7a2ac6d4675edf9e78a9e18e293' AND ip='71.76.38.58' LIMIT 1

Details of the error include:
---
Type: 20
File: (Line no. 0)
Message
SQL Error: 1317 - Query execution was interrupted
Query: SELECT * FROM mybb_sessions WHERE sid='6872f3355275cd6d5f35740e393823df' AND ip='173.70.106.222' LIMIT 1

Following is the mysql variables from phpmyadmin:
wait timeout 3,600
connect timeout 20

Sorry for the long post, but may I know how I can resolve this? The error is no longer happening anymore since the above log.

Thanks.
If these queries are timing out then they have serious problems with their servers. It's nothing you can do anything about, if a simple select query is taking more than 15 seconds to execute, something is very wrong. They'll probably be adamant it's our fault rather than theirs though.
I have no experience with hostgator but I can attest to the stability of MyBB.
I have not known any query on MyBB to take longer than 15 secs which your host states is the cutoff.

Only thing I can think of is that the host is overselling their servers where performance issues over a number of different users is accumulating and causing legit queries to get slowed down.

You could try turning off any options in the admin cp that state that they may cause a performance hit.
As a comparison; they're saying this is taking more than 15 seconds to run:

SELECT * FROM mybb_threads WHERE tid='18'

Here, this query:

SELECT * FROM mybb_threads WHERE tid='79252'

takes 0.000232 seconds. Two ten-thousandths of a second. Not 15 whole seconds.
Just to further discuss this, I am runnig MyBB 1.6 with template BlackEvo4 which is not compatible with MyBB 1.6 but its running fine in front. Nevertheless, non of the error states anything from the template.

The url is http://forum.notdstarcraft.com/
After showing the technician of Hostgator what MattRogowski posted above; I got the replies below:

Quote:Hello,

I have taken a look at your server, and the error seems intermittent, and as such I have tried to track down the issue further, however when going to your site for the first time it seems that your opening query takes at least 15 seconds to return the data needed for your site. I would consider either talking to the developers of your forums to see if they have any insight on to this, or the other option is to upgrade to a VPS as it is not limited by the 25 resource limit and your queries can take as long as they want. I am sorry for the inconvenience.
Sincerely,
Matthew Pumphrey
Linux Systems Administrator
HostGator.com LLC
http://support.hostgator.com

Does this mean first time user will face such problem when visiting my forum?