MyBB Community Forums

Full Version: Speed/Lag
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I've moved to a great webspace provider - but myBB is slower than I would like it - can someone please point me in the right direction for tweaking myBB to get the best possible speeds, ***please***?

thanks
Kev
enable debugging and copy/paste the debug stats (lower right hand corner on each page) for a few pages and post them up here.
1. Don't use too many plugins. It produces more queries on the database, making it slower.

2. Don't use ajax plugins. It makes the forum lag.

3. Use gzip page compression.

4. Enable Friendly Redirection Pages. It's like a blanket while the requested page loads.

5. If you have lots of forums, disable the Forum Jump Menu. That takes more time to load if there are many forums.

Those tips are just from personal experience. Other people may have different views and suggestions. Wink
Thanks Guys


MyBB Debug Information

Page Generation

Page Generation Statistics
Page Generation Time: 1.2854518890381 seconds No. DB Queries: 10
PHP Processing Time: 1.0020278 seconds (77.95%) DB Processing Time: 0.2834241 seconds (22.05%)
Extensions Used: mysql, xml Global.php Processing Time: 1.2146149 seconds
PHP Version: 5.2.12 Server Load: 12.68
GZip Encoding Status: Enabled No. Templates Used: 38 (45 Cached / 1 Manually Loaded)
Memory Usage: 4 MB (4194304 bytes) Memory Limit: 24M
Database Connections (1 Total)

[READ] [email protected] (Connected in 0s)

Database Queries (10 Total)

#1 - Write Query
SET NAMES 'utf8'
Query Time: 0.0028951168060303

#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.05494499206543

#3 - Select Query
SELECT * FROM mybb_sessions WHERE sid='722e7607aa930250eda6ab860e32eb04' AND ip='90.198.5.29' 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.005000114440918

#4 - Select Query
SELECT u.*, f.* FROM mybb_users u LEFT JOIN mybb_userfields f ON (f.ufid=u.uid) WHERE u.uid='206' 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: 0.011009931564331

#5 - Write Query
UPDATE mybb_sessions SET uid='206', time='1280350565', location='/index.php?debug=1', useragent='Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375', location1='0', location2='0', nopermission='0' WHERE sid='722e7607aa930250eda6ab860e32eb04' LIMIT 1
Query Time: 0.0022940635681152

#6 - Select Query
SELECT name, tid, properties, stylesheets FROM mybb_themes WHERE def='1' LIMIT 1
table type possible_keys key key_len ref rows Extra
mybb_themes ALL 3 Using where
Query Time: 0.0024240016937256

#7 - Select Query
SELECT title,template FROM mybb_templates WHERE title IN ('' ,'index' ,'index_whosonline' ,'index_welcomemembertext' ,'index_welcomeguest' ,'index_whosonline_memberbit' ,'forumbit_depth1_cat' ,'forumbit_depth1_forum' ,'forumbit_depth2_cat' ,'forumbit_depth2_forum' ,'forumbit_depth1_forum_lastpost' ,'forumbit_depth2_forum_lastpost' ,'index_modcolumn' ,'forumbit_moderators' ,'forumbit_subforums' ,'index_welcomeguesttext' ,'index_birthdays_birthday' ,'index_birthdays' ,'index_pms' ,'index_loginform' ,'index_logoutlink' ,'index_stats' ,'forumbit_depth3' ,'forumbit_depth3_statusicon' ,'index_boardstats' ,'' ,'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.019572019577026

(Plugin Hook: index_start)
#8 - Select Query
SELECT template FROM mybb_templates WHERE title='usergroup_legend' 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.015650987625122

#9 - Select Query
SELECT s.sid, s.ip, s.uid, s.time, s.location, s.location1, u.username, u.invisible, u.usergroup, u.displaygroup FROM mybb_sessions s LEFT JOIN mybb_users u ON (s.uid=u.uid) WHERE s.time>'1280349665' ORDER BY u.username ASC, s.time DESC
table type possible_keys key key_len ref rows Extra
s range time time 8 6 Using where; Using temporary; Using filesort
u ref PRIMARY,uid uid 4 C286080_mock.s.uid 1
Query Time: 0.0040440559387207

#10 - Select Query
SELECT f.*, fr.dateline AS lastread FROM mybb_forums f LEFT JOIN mybb_forumsread fr ON (fr.fid=f.fid AND fr.uid='206') WHERE f.active != 0 ORDER BY pid, disporder
table type possible_keys key key_len ref rows Extra
f ALL 20 Using where; Using filesort
fr eq_ref fid,fid_2,uid fid 8 C286080_mock.f.fid,const 1
Query Time: 0.0063438415527344

Template Statistics

Templates Used (Loaded for this Page) - 38 Total
global_pm_alert, index, header_welcomeblock_member, header_welcomeblock_member_moderator, header_welcomeblock_member_admin, redirect, gobutton, forumbit_depth2_forum, forumbit_depth3, forumbit_depth3_statusicon, forumbit_subforums, footer, headerinclude, nav_sep, nav_sep_active, header_welcomeblock_guest, header, forumbit_depth1_cat, global_unreadreports, index_loginform, index_whosonline, index_stats, index_birthdays_birthday, forumbit_moderators, index_birthdays, index_logoutlink, error, index_whosonline_memberbit, forumbit_depth2_cat, nav, nav_bit, nav_bit_active, htmldoctype, footer_languageselect, index_boardstats, forumbit_depth2_forum_lastpost, forumbit_depth1_forum_lastpost, usergroup_legend

Templates Requiring Additional Calls (Not Cached at Startup) - 1 Total
usergroup_legend
Server load seems very high.
You've already been on a slow server before haven't you... there's no way it should be taking that long to run 10 queries, server load is ridiculous. I'm currently working on a forum on a shared host, my index is running ten times the number of queries yours is but it's being generated in less than a tenth of the time. Are you on a shared host now?? Looks like it's being oversold to me.
MyBB Debug Information

Page Generation

Page Generation Statistics
Page Generation Time: 2.1270849704742 seconds No. DB Queries: 24
PHP Processing Time: 0.6019559 seconds (28.30%) DB Processing Time: 1.5251291 seconds (71.70%)
Extensions Used: mysql, xml Global.php Processing Time: 1.2855530 seconds
PHP Version: 5.2.12 Server Load: 12.81
GZip Encoding Status: Enabled No. Templates Used: 89 (97 Cached / 0 Manually Loaded)
Memory Usage: 4.5 MB (4718592 bytes) Memory Limit: 24M
Database Connections (1 Total)

[READ] [email protected] (Connected in 0s)

Database Queries (24 Total)

#1 - Write Query
SET NAMES 'utf8'
Query Time: 0.0058219432830811

#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.58872509002686

#3 - Select Query
SELECT * FROM mybb_sessions WHERE sid='722e7607aa930250eda6ab860e32eb04' AND ip='90.198.5.29' 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.0046608448028564

#4 - Select Query
SELECT u.*, f.* FROM mybb_users u LEFT JOIN mybb_userfields f ON (f.ufid=u.uid) WHERE u.uid='206' 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: 0.057069063186646

#5 - Select Query
SELECT * FROM mybb_threads WHERE tid='3997'
table type possible_keys key key_len ref rows Extra
mybb_threads const PRIMARY,tid PRIMARY 4 const 1
Query Time: 0.0029799938201904

#6 - Write Query
UPDATE mybb_sessions SET uid='206', time='1280352091', location='/showthread.php?tid=3997&pid=106669&debug=1', useragent='Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375', location1='15', location2='3997', nopermission='0' WHERE sid='722e7607aa930250eda6ab860e32eb04' LIMIT 1
Query Time: 0.21315217018127

#7 - Select Query
SELECT f.style, f.overridestyle, p.* FROM mybb_forums f LEFT JOIN mybb_posts p ON(f.fid=p.fid) WHERE p.pid='106669' LIMIT 1
table type possible_keys key key_len ref rows Extra
p const PRIMARY,pid PRIMARY 4 const 1
f const PRIMARY,fid PRIMARY 2 const 1
Query Time: 0.0032870769500732

#8 - Select Query
SELECT name, tid, properties, stylesheets FROM mybb_themes WHERE def='1' LIMIT 1
table type possible_keys key key_len ref rows Extra
mybb_themes ALL 3 Using where
Query Time: 0.0030159950256348

#9 - Select Query
SELECT title,template FROM mybb_templates WHERE title IN ('' ,'showthread' ,'postbit' ,'postbit_author_user' ,'postbit_author_guest' ,'showthread_newthread' ,'showthread_newreply' ,'showthread_newreply_closed' ,'postbit_sig' ,'showthread_newpoll' ,'postbit_avatar' ,'postbit_profile' ,'postbit_find' ,'postbit_pm' ,'postbit_www' ,'postbit_email' ,'postbit_edit' ,'postbit_quote' ,'postbit_report' ,'postbit_signature' ,'postbit_online' ,'postbit_offline' ,'postbit_away' ,'postbit_gotopost' ,'showthread_ratethread' ,'showthread_inline_ratethread' ,'showthread_moderationoptions' ,'multipage_prevpage' ,'multipage_nextpage' ,'multipage_page_current' ,'multipage_page' ,'multipage_start' ,'multipage_end' ,'multipage' ,'postbit_editedby' ,'showthread_similarthreads' ,'showthread_similarthreads_bit' ,'postbit_iplogged_show' ,'postbit_iplogged_hiden' ,'showthread_quickreply' ,'forumjump_advanced' ,'forumjump_special' ,'forumjump_bit' ,'showthread_multipage' ,'postbit_reputation' ,'postbit_quickdelete' ,'postbit_attachments' ,'thumbnails_thumbnail' ,'postbit_attachments_attachment' ,'postbit_attachments_thumbnails' ,'postbit_attachments_images_image' ,'postbit_attachments_images' ,'postbit_posturl' ,'postbit_inlinecheck' ,'showthread_inlinemoderation' ,'postbit_attachments_thumbnails_thumbnail' ,'postbit_quickquote' ,'postbit_qqmessage' ,'postbit_seperator' ,'postbit_groupimage' ,'postbit_multiquote' ,'showthread_search' ,'postbit_warn' ,'postbit_warninglevel' ,'showthread_moderationoptions_custom_tool' ,'showthread_moderationoptions_custom' ,'showthread_inlinemoderation_custom_tool' ,'showthread_inlinemoderation_custom' ,'postbit_classic' ,'showthread_classic_header' ,'showthread_poll_resultbit' ,'showthread_poll_results' ,'thankyoulike_users' ,'thankyoulike' ,'thankyoulike_classic' ,'thankyoulike_expcollapse' ,'thankyoulike_button_add' ,'thankyoulike_button_del' ,'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.085857152938843

#10 - Write Query
REPLACE INTO mybb_threadsread (tid, uid, dateline) VALUES('3997', '206', '1280352091')
Query Time: 0.0031008720397949

#11 - Select Query
SELECT COUNT(t.tid) AS unread_count FROM mybb_threads t LEFT JOIN mybb_threadsread tr ON (tr.tid=t.tid AND tr.uid='206') LEFT JOIN mybb_forumsread fr ON (fr.fid=t.fid AND fr.uid='206') WHERE t.visible=1 AND t.closed NOT LIKE 'moved|%' AND t.fid IN (15) AND t.lastpost > IFNULL(tr.dateline,1279747291) AND t.lastpost > IFNULL(fr.dateline,1279747291) AND t.lastpost>1279747291
table type possible_keys key key_len ref rows Extra
t range fid,lastpost lastpost 8 87 Using where
tr eq_ref tid,tid_2 tid 8 C286080_mock.t.tid,const 1 Using where
fr const fid,fid_2,uid fid 8 const,const 1 Using where
Query Time: 0.0028531551361084

#12 - Select Query
SELECT uid FROM mybb_threadratings WHERE tid='3997' AND uid='206'
table type possible_keys key key_len ref rows Extra
mybb_threadratings ref tid tid 8 const,const 1 Using index
Query Time: 0.003140926361084

#13 - Select Query
SELECT COUNT(p.pid) AS count FROM mybb_posts p WHERE p.tid='3997' AND p.pid <= '106669' AND (p.visible='0' OR p.visible='1')
table type possible_keys key key_len ref rows Extra
p ref PRIMARY,tid,visible,pid tid 4 const 65 Using where
Query Time: 0.0027730464935303

#14 - Select Query
SELECT COUNT(*) AS replies FROM mybb_posts p WHERE p.tid='3997' AND (p.visible='0' OR p.visible='1')
table type possible_keys key key_len ref rows Extra
p ref tid,visible tid 4 const 65 Using where
Query Time: 0.20711088180542

#15 - Select Query
SELECT p.pid FROM mybb_posts p WHERE p.tid='3997' AND (p.visible='0' OR p.visible='1') ORDER BY p.dateline LIMIT 0, 15
table type possible_keys key key_len ref rows Extra
p ref tid,visible tid 4 const 65 Using where; Using filesort
Query Time: 0.0026760101318359

#16 - Select Query
SELECT * FROM mybb_attachments WHERE pid IN('106660','106663','106666','106669')
table type possible_keys key key_len ref rows Extra
mybb_attachments range pid pid 4 18 Using where
Query Time: 0.0035479068756104

#17 - Select Query
SELECT u.*, u.username AS userusername, p.*, f.*, eu.username AS editusername FROM mybb_posts p LEFT JOIN mybb_users u ON (u.uid=p.uid) LEFT JOIN mybb_userfields f ON (f.ufid=u.uid) LEFT JOIN mybb_users eu ON (eu.uid=p.edituid) WHERE pid IN('106660','106663','106666','106669') ORDER BY p.dateline
table type possible_keys key key_len ref rows Extra
p range PRIMARY,pid PRIMARY 4 4 Using where; Using filesort
u ref PRIMARY,uid uid 4 C286080_mock.p.uid 1
f eq_ref PRIMARY,ufid PRIMARY 4 C286080_mock.u.uid 1
eu ref PRIMARY,uid uid 4 C286080_mock.p.edituid 1
Query Time: 0.020022869110107

(Plugin Hook: postbit)
#18 - Select Query
SELECT u.username, u.usergroup, u.displaygroup, tyl.* FROM mybb_g33k_thankyoulike_thankyoulike tyl LEFT JOIN mybb_users u ON (u.uid=tyl.uid) WHERE tyl.pid='106660' ORDER BY username ASC
table type possible_keys key key_len ref rows Extra
tyl ref pid pid 4 const 1 Using temporary; Using filesort
u eq_ref PRIMARY,uid PRIMARY 4 C286080_mock.tyl.uid 1
Query Time: 0.023960113525391

(Plugin Hook: postbit)
#19 - Select Query
SELECT u.username, u.usergroup, u.displaygroup, tyl.* FROM mybb_g33k_thankyoulike_thankyoulike tyl LEFT JOIN mybb_users u ON (u.uid=tyl.uid) WHERE tyl.pid='106663' ORDER BY username ASC
table type possible_keys key key_len ref rows Extra
tyl ref pid pid 4 const 1 Using temporary; Using filesort
u eq_ref PRIMARY,uid PRIMARY 4 C286080_mock.tyl.uid 1
Query Time: 0.0030109882354736

(Plugin Hook: postbit)
#20 - Select Query
SELECT u.username, u.usergroup, u.displaygroup, tyl.* FROM mybb_g33k_thankyoulike_thankyoulike tyl LEFT JOIN mybb_users u ON (u.uid=tyl.uid) WHERE tyl.pid='106666' ORDER BY username ASC
table type possible_keys key key_len ref rows Extra
tyl ref pid pid 4 const 1 Using temporary; Using filesort
u eq_ref PRIMARY,uid PRIMARY 4 C286080_mock.tyl.uid 1
Query Time: 0.021091938018799

(Plugin Hook: postbit)
#21 - Select Query
SELECT u.username, u.usergroup, u.displaygroup, tyl.* FROM mybb_g33k_thankyoulike_thankyoulike tyl LEFT JOIN mybb_users u ON (u.uid=tyl.uid) WHERE tyl.pid='106669' ORDER BY username ASC
table type possible_keys key key_len ref rows Extra
tyl ref pid pid 4 const 1 Using temporary; Using filesort
u eq_ref PRIMARY,uid PRIMARY 4 C286080_mock.tyl.uid 1
Query Time: 0.0086669921875

#22 - Select Query
SELECT pid FROM mybb_posts WHERE tid='3997' ORDER BY pid DESC LIMIT 1
table type possible_keys key key_len ref rows Extra
mybb_posts ref tid tid 4 const 65 Using where; Using filesort
Query Time: 0.0028231143951416

#23 - Select Query
SELECT tid, name, type FROM mybb_modtools WHERE CONCAT(',',forums,',') LIKE '%,15,%' OR 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.0031228065490723

#24 - Select Query
SELECT tid FROM mybb_threadsubscriptions WHERE tid='3997' AND uid='206' LIMIT 1
table type possible_keys key key_len ref rows Extra
mybb_threadsubscriptions ref uid,tid uid 4 const 1 Using where
Query Time: 0.0029749870300293

Template Statistics

Templates Used (Loaded for this Page) - 89 Total
global_pm_alert, header_welcomeblock_member, header_welcomeblock_member_moderator, postbit_online, showthread_moderationoptions, showthread_moderationoptions_custom, showthread_moderationoptions_custom_tool, showthread_inlinemoderation_custom, showthread_inlinemoderation_custom_tool, showthread_inlinemoderation, showthread_classic_header, showthread, showthread_ratethread, forumjump_advanced, header_welcomeblock_member_admin, redirect, gobutton, postbit_away, footer, headerinclude, showthread_similarthreads, nav_sep, nav_sep_active, header_welcomeblock_guest, header, showthread_newreply_closed, postbit_edit, postbit_email, postbit_find, postbit_pm, postbit_quickdelete, postbit_quote, postbit_report, postbit_www, showthread_poll_resultbit, postbit_avatar, showthread_quickreply, postbit, postbit_classic, postbit_gotopost, postbit_seperator, postbit_groupimage, showthread_newreply, showthread_newthread, showthread_poll_results, global_unreadreports, multipage, multipage_end, multipage_nextpage, multipage_page, multipage_page_current, multipage_prevpage, multipage_start, postbit_attachments_thumbnails, postbit_posturl, postbit_attachments_thumbnails_thumbnail, postbit_attachments_images_image, postbit_signature, postbit_attachments, postbit_attachments_attachment, postbit_attachments_images, postbit_reputation, showthread_multipage, postbit_iplogged_hiden, postbit_iplogged_show, forumjump_bit, forumjump_special, showthread_similarthreads_bit, postbit_offline, postbit_editedby, error, nav, nav_bit, nav_bit_active, postbit_inlinecheck, htmldoctype, postbit_multiquote, postbit_author_user, postbit_author_guest, showthread_search, footer_languageselect, postbit_warninglevel, postbit_warn, thankyoulike, thankyoulike_classic, thankyoulike_expcollapse, thankyoulike_button_add, thankyoulike_button_del, thankyoulike_users

Templates Requiring Additional Calls (Not Cached at Startup) - 0 Total
time to find another host. this has nothing to do with mybb
I just joined them today! They came really quite recommended by other heavy forum admins!
they put you on an overloaded server, another site on that server is causing you problems, or something is up with your move and still running the background perhaps.

How did you move your site over? What control panel are you using? Can you see the server load from that control panel?
Pages: 1 2