MyBB Community Forums

Full Version: High Page Generation Times
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to figure out what could be causing ultra high page generation times on a MyBB board, and I just can't. I've made sure the db is indexed properly and every other db optimization trick I know or could find online. Any ideas are valuable. PHP 5.2.6, MySQL 5.0.22.

I'm at a loss and it is very frustrating. If you look at the screenshots I've attached you'll see 30+ to 70+ page generation times. The codeblock below was a 35ish second gen time.

Database Queries (17 Total)
#1 - Write Query
SET NAMES 'utf8'
Query Time: 0.015413999557495

#2 - Select Query
SELECT title,cache FROM mybb_datacache
table 	type 	possible_keys 	key 	key_len 	ref 	rows 	Extra
mybb_datacache 	ALL 					26 	
Query Time: 0.2073438167572

#3 - Select Query
SELECT * FROM mybb_sessions WHERE sid='ccb76cd19ecc034aff02745bb4463239' AND ip='173.80.64.188' LIMIT 1
table 	type 	possible_keys 	key 	key_len 	ref 	rows 	Extra
mybb_sessions 	const 	PRIMARY,ip,sid 	PRIMARY 	98 	const 	1 	
Query Time: 0.17893290519714

#4 - Select Query
SELECT u.*, f.* FROM mybb_users u LEFT JOIN mybb_userfields f ON (f.ufid=u.uid) WHERE u.uid='118' LIMIT 1
table 	type 	possible_keys 	key 	key_len 	ref 	rows 	Extra
u 	const 	PRIMARY,uid 	PRIMARY 	4 	const 	1 	
f 	const 	PRIMARY,ufid 	PRIMARY 	4 	const 	1 	
Query Time: 2.3291149139404

#5 - Write Query
UPDATE mybb_sessions SET `uid`='118', `time`='1265862982', `location`='/search.php?action=results&sid=21b40c663d2adbe550fc585daa67fd62&debug=1', `useragent`='[edited for privacy]', `location1`='0', `location2`='0', `nopermission`='0' WHERE sid='ccb76cd19ecc034aff02745bb4463239' LIMIT 1
Query Time: 0.013830900192261

#6 - Select Query
SELECT name, tid, properties, stylesheets FROM mybb_themes WHERE tid='5' LIMIT 1
table 	type 	possible_keys 	key 	key_len 	ref 	rows 	Extra
mybb_themes 	const 	PRIMARY,tid 	PRIMARY 	2 	const 	1 	
Query Time: 0.027029991149902

#7 - Select Query
SELECT title,template FROM mybb_templates WHERE title IN ('' ,'search' ,'forumdisplay_thread_gotounread' ,'search_results_threads_thread' ,'search_results_threads' ,'search_results_posts' ,'search_results_posts_post' ,'multipage_nextpage' ,'multipage_page_current' ,'multipage_page' ,'multipage_start' ,'multipage_end' ,'multipage' ,'forumdisplay_thread_multipage_more' ,'forumdisplay_thread_multipage_page' ,'forumdisplay_thread_multipage' ,'search_results_posts_inlinecheck' ,'search_results_posts_nocheck' ,'search_results_threads_inlinecheck' ,'search_results_threads_nocheck' ,'search_results_inlinemodcol' ,'search_results_posts_inlinemoderation_custom_tool' ,'search_results_posts_inlinemoderation_custom' ,'search_results_posts_inlinemoderation' ,'search_results_threads_inlinemoderation_custom_tool' ,'search_results_threads_inlinemoderation_custom' ,'search_results_threads_inlinemoderation' ,'search_orderarrow' ,'' ,'css' ,'headerinclude' ,'header' ,'footer' ,'gobutton' ,'htmldoctype' ,'header_welcomeblock_member' ,'header_welcomeblock_guest' ,'header_welcomeblock_member_admin' ,'global_pm_alert' ,'global_unreadreports' ,'nav' ,'nav_sep' ,'nav_bit' ,'nav_sep_active' ,'nav_bit_active' ,'footer_languageselect' ,'header_welcomeblock_member_moderator' ,'redirect' ,'error') AND sid IN ('-2','-1','4') ORDER BY sid ASC
table 	type 	possible_keys 	key 	key_len 	ref 	rows 	Extra
mybb_templates 	ALL 					594 	Using where; Using filesort
Query Time: 0.013573884963989

#8 - Select Query
SELECT * FROM mybb_searchlog WHERE sid='21b40c663d2adbe550fc585daa67fd62'
table 	type 	possible_keys 	key 	key_len 	ref 	rows 	Extra
mybb_searchlog 	const 	PRIMARY,sid 	PRIMARY 	98 	const 	1 	
Query Time: 0.0025389194488525

#9 - Select Query
SELECT f.fid, fr.dateline AS lastread FROM mybb_forums f LEFT JOIN mybb_forumsread fr ON (fr.fid=f.fid AND fr.uid='118') WHERE f.active != 0 ORDER BY pid, disporder
table 	type 	possible_keys 	key 	key_len 	ref 	rows 	Extra
f 	ALL 					17 	Using where; Using filesort
fr 	eq_ref 	fid,fid_2,uid 	fid 	8 	[edited for privacy].f.fid,const 	1 	
Query Time: 0.0072929859161377

#10 - Select Query
SELECT fid FROM mybb_moderators WHERE uid='118'
table 	type 	possible_keys 	key 	key_len 	ref 	rows 	Extra
mybb_moderators 	ref 	uid 	uid 	4 	const 	1 	Using index
Query Time: 0.0010919570922852

#11 - Select Query
SELECT t.tid FROM mybb_threads t WHERE t.lastpost >= '1265855825' AND t.fid NOT IN ('17') AND t.fid NOT IN (17) AND t.visible>-1 AND t.closed NOT LIKE 'moved|%'
table 	type 	possible_keys 	key 	key_len 	ref 	rows 	Extra
t 	range 	fid,lastpost 	lastpost 	8 		8 	Using where
Query Time: 0.87356495857239

#12 - Select Query
SELECT t.*, u.username AS userusername FROM mybb_threads t LEFT JOIN mybb_users u ON (u.uid=t.uid) WHERE t.tid IN (3772,3783,3802,3788) AND t.visible>-1 AND t.closed NOT LIKE 'moved|%' ORDER BY t.lastpost desc LIMIT 0, 20
table 	type 	possible_keys 	key 	key_len 	ref 	rows 	Extra
t 	range 	PRIMARY,tid 	PRIMARY 	4 		4 	Using where; Using filesort
u 	ref 	PRIMARY,uid 	uid 	4 	[edited for privacy].t.uid 	1 	
Query Time: 5.9314658641815

#13 - Select Query
SELECT DISTINCT tid,uid FROM mybb_posts WHERE uid='118' AND tid IN(3788,3802,3783,3772)
table 	type 	possible_keys 	key 	key_len 	ref 	rows 	Extra
mybb_posts 	range 	tid,uid 	tid 	8 		18 	Using where; Using index; Using temporary
Query Time: 0.00038504600524902

#14 - Select Query
SELECT tid,dateline FROM mybb_threadsread WHERE uid='118' AND tid IN(3788,3802,3783,3772)
table 	type 	possible_keys 	key 	key_len 	ref 	rows 	Extra
mybb_threadsread 	range 	tid,tid_2 	tid 	8 		4 	Using where
Query Time: 0.0054130554199219

#15 - Select Query
SELECT template FROM mybb_templates WHERE title='forumdisplay_thread_attachment_count' AND sid IN ('-2','-1','4') ORDER BY sid DESC LIMIT 1
table 	type 	possible_keys 	key 	key_len 	ref 	rows 	Extra
mybb_templates 	ALL 					594 	Using where; Using filesort
Query Time: 0.0019030570983887

#16 - Select Query
SELECT template FROM mybb_templates WHERE title='forumdisplay_threadlist_inlineedit_js' AND sid IN ('-2','-1','4') ORDER BY sid DESC LIMIT 1
table 	type 	possible_keys 	key 	key_len 	ref 	rows 	Extra
mybb_templates 	ALL 					594 	Using where; Using filesort
Query Time: 0.001723051071167

#17 - Select Query
SELECT tid, name FROM mybb_modtools WHERE type='t' AND (CONCAT(',',forums,',') LIKE '%,-1,%' OR forums='')
table 	type 	possible_keys 	key 	key_len 	ref 	rows 	Extra
							Impossible WHERE noticed after reading const tables
Query Time: 0.016939878463745

Template Statistics
Templates Used (Loaded for this Page) - 48 Total
global_pm_alert, header_welcomeblock_member, header_welcomeblock_member_moderator, header_welcomeblock_member_admin, redirect, gobutton, footer, headerinclude, nav_sep, nav_sep_active, header_welcomeblock_guest, header, forumdisplay_thread_gotounread, search, global_unreadreports, multipage, multipage_end, multipage_nextpage, multipage_page, multipage_page_current, multipage_start, search_results_threads_thread, search_results_threads, search_results_posts_post, search_results_posts, forumdisplay_thread_multipage, forumdisplay_thread_multipage_page, forumdisplay_thread_multipage_more, error, nav, nav_bit, nav_bit_active, htmldoctype, footer_languageselect, search_orderarrow, search_results_posts_inlinecheck, search_results_posts_nocheck, search_results_threads_inlinecheck, search_results_threads_nocheck, search_results_inlinemodcol, search_results_posts_inlinemoderation_custom, search_results_posts_inlinemoderation_custom_tool, search_results_posts_inlinemoderation, search_results_threads_inlinemoderation_custom, search_results_threads_inlinemoderation_custom_tool, search_results_threads_inlinemoderation, forumdisplay_thread_attachment_count, forumdisplay_threadlist_inlineedit_js

Templates Requiring Additional Calls (Not Cached at Startup) - 2 Total
forumdisplay_thread_attachment_count, forumdisplay_threadlist_inlineedit_js

[attachment=17312]
[attachment=17313]
[attachment=17314]
Wow... Some of those queries take longer than 5 seconds...

And with a low serverload.. Weird. Wish i could help you...
Contact your host, looks like possibly an overloaded MySQL server.
(2010-02-11, 08:49 AM)TimB. Wrote: [ -> ]Contact your host, looks like possibly an overloaded MySQL server.

That's what I thought as well. The initial "Level 1" tech support tried telling us its because our db has over 120,000 records. I just had to laugh. That's not that big of a db for a forum.

I'm going to try running with all plugins disabled if this keeps on. Hopefully it won't. And if it does, I've already spoken to a Level 3 tech about getting us moved to a different MySQL server.

Thanks guys.