2011-12-28, 03:32 PM
First of all, thank you MyBB team for making such an awesome software. I previously had issues due to high memory usage, which were solved and I brought down the memory usage from around 50 mb to 17 mb. And now it doesn't even climb to 18 mb.
Nowadays my forum is getting a huge number of users. Around 200 members stay online continuously because it is a study site and they look for assignment solutions. I disabled the main plugins, like the shoutbox, which brought down cpu usage.
The server is a vps, Quad Core Xeon processor at 2.4 Ghz. The Ram is around 1 GB with burst memory at around 2 GB. So the server is quite capable of handling my website. But I have noticed that the high user number has drastically overloaded the MySQL server. What I basically want is to optimize the databases. Perhaps some big board owners might help me out here, as they are experienced with handling high users. The server is Apache 2.2, with PHP version 5.2.17. Here is the Debug info.
As you can see, 69 % of the load time is actually MySQL request time.
Any help would be greatly appreciated.
Nowadays my forum is getting a huge number of users. Around 200 members stay online continuously because it is a study site and they look for assignment solutions. I disabled the main plugins, like the shoutbox, which brought down cpu usage.
The server is a vps, Quad Core Xeon processor at 2.4 Ghz. The Ram is around 1 GB with burst memory at around 2 GB. So the server is quite capable of handling my website. But I have noticed that the high user number has drastically overloaded the MySQL server. What I basically want is to optimize the databases. Perhaps some big board owners might help me out here, as they are experienced with handling high users. The server is Apache 2.2, with PHP version 5.2.17. Here is the Debug info.
MyBB Debug Information
Page Generation Statistics
Page Generation Time: 1.28144907951 seconds No. DB Queries: 14
PHP Processing Time: 0.5529544 seconds (43.15%) DB Processing Time: 0.7284946 seconds (56.85%)
Extensions Used: mysql, xml Global.php Processing Time: 0.2974689 seconds
PHP Version: 5.2.17 Server Load: 2.56
GZip Encoding Status: Disabled No. Templates Used: 39 (46 Cached / 1 Manually Loaded)
Memory Usage: 17.5 MB (18350080 bytes) Memory Limit: 100M
Database Connections (1 Total)
[READ] alimaula_newask@localhost (Connected in 0s)
Database Queries (14 Total)
#1 - Write Query
SET NAMES 'utf8'
Query Time: 0.000115871429443
#2 - Select Query
SELECT title,cache FROM mybb_datacache
table type possible_keys key key_len ref rows Extra
mybb_datacache ALL 37
Query Time: 0. 00527596473694
#3 - Select Query
SELECT * FROM mybb_sessions WHERE sid='95a5d4c89c37e59affbf6bc2fa1d7bb8' AND ip='110.36.90.88' LIMIT 1
table type possible_keys key key_len ref rows Extra
mybb_sessions const PRIMARY,ip PRIMARY 98 const 1
Query Time: 0.00970506668091
#4 - Select Query
SELECT u.*, f.* FROM mybb_users u LEFT JOIN mybb_userfields f ON (f.ufid=u.uid) WHERE u.uid='482' LIMIT 1
table type possible_keys key key_len ref rows Extra
u const PRIMARY PRIMARY 4 const 1
f const PRIMARY PRIMARY 4 const 1
Query Time: 0.0152690410614
#5 - Write Query
UPDATE mybb_sessions SET `uid`='482', `time`='1325085462', `location`='/index.php?debug=1', `useragent`='Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7', `location1`='0', `location2`='0', `nopermission`='0' WHERE sid='95a5d4c89c37e59affbf6bc2fa1d7bb8' LIMIT 1
Query Time: 0.0154020786285
#6 - Select Query
SELECT name, tid, properties, stylesheets FROM mybb_themes WHERE tid='13' LIMIT 1
table type possible_keys key key_len ref rows Extra
mybb_themes const PRIMARY PRIMARY 2 const 1
Query Time: 0.0118100643158
#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' ,'' ,'global_pending_joinrequests' ,'nav' ,'nav_sep' ,'nav_bit' ,'nav_sep_active' ,'nav_bit_active' ,'footer_languageselect' ,'header_welcomeblock_member_moderator' ,'redirect' ,'error') AND sid IN ('-2','-1','12') ORDER BY sid ASC
table type possible_keys key key_len ref rows Extra
mybb_templates ALL 1952 Using where; Using filesort
Query Time: 0.0195319652557
(Plugin Hook: index_start)
#8 - Select Query
SELECT u.uid,u.username,u.displaygroup,u.usergroup,u.avatar,COUNT(*) AS ptoday FROM mybb_posts p LEFT JOIN mybb_users u ON (p.uid=u.uid) WHERE p.dateline > 1324999062 GROUP BY p.uid ORDER BY ptoday DESC LIMIT 0,5
table type possible_keys key key_len ref rows Extra
p range dateline dateline 8 157 Using where; Using temporary; Using filesort
u eq_ref PRIMARY PRIMARY 4 alimaula_vuaskari.p.uid 1
Query Time: 0.0249288082123
(Plugin Hook: index_start)
#9 - Select Query
SELECT u.uid,u.username,u.displaygroup,u.usergroup, u.avatar ,COUNT(*) AS pweek FROM mybb_posts p LEFT JOIN mybb_users u ON (p.uid=u.uid) WHERE p.dateline > 1324480662 GROUP BY p.uid ORDER BY pweek DESC LIMIT 0,5
table type possible_keys key key_len ref rows Extra
p range dateline dateline 8 605 Using where; Using temporary; Using filesort
u eq_ref PRIMARY PRIMARY 4 alimaula_vuaskari.p.uid 1
Query Time: 0.01833319664
(Plugin Hook: index_start)
#10 - Select Query
SELECT u.uid,u.username,u.displaygroup,u.usergroup,u.avatar,COUNT(*) AS pmonth FROM mybb_posts p LEFT JOIN mybb_users u ON (p.uid=u.uid) WHERE p.dateline > 1322493462 GROUP BY p.uid ORDER BY pmonth DESC LIMIT 0,5
table type possible_keys key key_len ref rows Extra
p range dateline dateline 8 1553 Using where; Using temporary; Using filesort
u eq_ref PRIMARY PRIMARY 4 alimaula_vuaskari.p.uid 1
Query Time: 0.0290710926056
(Plugin Hook: index_start)
#11 - Select Query
SELECT * FROM mybb_users ORDER BY postnum DESC LIMIT 0,5
table type possible_keys key key_len ref rows Extra
mybb_users ALL 23634 Using filesort
Query Time: 0.527192831039
(Plugin Hook: index_start)
#12 - Select Query
SELECT template FROM mybb_templates WHERE title='itp' AND sid IN ('-2','-1','12') ORDER BY sid DESC LIMIT 1
table type possible_keys key key_len ref rows Extra
mybb_templates ALL 1952 Using where; Using filesort
Query Time: 0. 0054919719696
#13 - 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>'1325084562' ORDER BY u.username ASC, s.time DESC
table type possible_keys key key_len ref rows Extra
s range time time 8 275 Using where; Using temporary; Using filesort
u eq_ref PRIMARY PRIMARY 4 alimaula_vuaskari.s.uid 1
Query Time: 0.01722407341
#14 - 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='482') WHERE f.active != 0 ORDER BY pid, disporder
table type possible_keys key key_len ref rows Extra
f ALL 743 Using where; Using filesort
fr eq_ref fid fid 8 alimaula_vuaskari.f.fid,const 1
Query Time: 0.0229618549347
As you can see, 69 % of the load time is actually MySQL request time.
Any help would be greatly appreciated.