PDA

View Full Version : Forumhome takes 9.88554597 seconds to load??


Hostc
07-13-2003, 06:01 AM
Page generated in 9.88554597 seconds (1.38% PHP - 98.62% MySQL) with 26 queries.
[Debug Mode OFF] [PHP v4.3.2] [GZIP disabled] [Server Load: 1.02 ยป 0.53 : 0.26]

{Edited out}

what can I do to make this load faster?

Erwin
07-13-2003, 06:54 AM
Wow... that's slow.

First of all, you can add "'forumhome_hotattachment" and "10stat" to the $templatesused variable at the top so they are cached - saves you 2 queries.

Also, you may want to try removing the Hot Attachment and/or Stats hacks - try removing one or the other, to see if it helps. It's going to be a hack that's searching a large table.

Hostc
07-13-2003, 06:58 AM
What do you mean "or Stats hacks"

I dont have a stats hack on forumhome?

Hostc
07-13-2003, 07:34 AM
Page generated in 0.33039796 seconds (47.16% PHP - 52.84% MySQL) with 23 queries.
[Debug Mode OFF] [PHP v4.3.2] [GZIP disabled] [Server Load: 0.09 ? 0.08 : 0.12]

After I removed the hottest attachment hack :laugh:





Query: SELECT template FROM template WHERE title='options'
Time before: 0.040796041488647
Time after: 0.046677947044373

--------------------------------------------------------------------------------

Query: SELECT sessionhash,userid,host,useragent,styleid FROM session WHERE lastactivity>1058084624 AND sessionhash='b6bae515013d520b1bb5161381f6eab1' AND (host='12.225.249.167' OR (althash='' AND althash<>'')) AND useragent='Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;'
Time before: 0.052404046058655
Time after: 0.057258009910583

--------------------------------------------------------------------------------

Query: SELECT user.*,userfield.* FROM user LEFT JOIN userfield ON userfield.userid=user.userid WHERE user.userid='157'
Time before: 0.057469010353088
Time after: 0.064910054206848

--------------------------------------------------------------------------------

Query: INSERT INTO session (sessionhash,userid,host,useragent,lastactivity,al thash,location,styleid) VALUES ('f145afe442b7f2a4e981cd225392547c','157','12.225. 249.167','Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;','1058085524','','/restricted/index.php?&showqueries=1',1)
Time before: 0.078992009162903
Time after: 0.082734942436218

--------------------------------------------------------------------------------

Query: SELECT templatesetid,replacementsetid,userselect FROM style WHERE styleid='1'
Time before: 0.083199024200439
Time after: 0.085405945777893

--------------------------------------------------------------------------------

Query: SELECT template,title
FROM template
WHERE (title IN ('colforumtableheader','colforumtablefooter','colf orumbit','forumhome_birthdaybit','error_nopermissi on','forumhome_pmloggedin','forumhome_welcometext' ,'forumhome_logoutcode','forumhome_newposts','foru mhome_todayposts','forumhome_logincode','forumhome _loggedinuser','forumhome_loggedinusers','forumhom e_lastpostby','forumhome_moderator','forumhome_for umbit_level1_nopost','forumhome_forumbit_level1_po st','forumhome_forumbit_level2_nopost','forumhome_ forumbit_level2_post','forumhome','forumhome_unreg message','gobutton','timezone','username_loggedout ','username_loggedin','phpinclude','headinclude',' header','footer','forumjumpbit','forumjump','nav_l inkoff','nav_linkon','navbar','nav_joiner','pagena v','pagenav_curpage','pagenav_firstlink','pagenav_ lastlink','pagenav_nextlink','pagenav_pagelink','p agenav_prevlink')
AND (templatesetid=-1 OR templatesetid=10))
OR (title = 'maxloggedin')
OR (title = 'birthdays')
ORDER BY templatesetid
Time before: 0.085641026496887
Time after: 0.14707696437836

--------------------------------------------------------------------------------

Query: SELECT * FROM usergroup WHERE usergroupid=6
Time before: 0.15890395641327
Time after: 0.16202998161316

--------------------------------------------------------------------------------

Query: SHOW TABLE STATUS
Time before: 0.16271901130676
Time after: 0.17820799350739

--------------------------------------------------------------------------------

Query: SELECT user.avatarid,avatarpath,NOT ISNULL(avatardata) AS hascustom,customavatar.dateline
FROM user
LEFT JOIN avatar ON avatar.avatarid=user.avatarid
LEFT JOIN customavatar ON customavatar.userid=user.userid
WHERE user.userid='157'
Time before: 0.18027603626251
Time after: 0.18594300746918

--------------------------------------------------------------------------------

Query:
SELECT privatemessageid, messageread, dateline, folderid
FROM privatemessage
WHERE userid = 157
Time before: 0.18610298633575
Time after: 0.18868398666382

--------------------------------------------------------------------------------

Query: SELECT userid,username,posts FROM user ORDER BY posts DESC LIMIT 10
Time before: 0.19193005561829
Time after: 0.19978296756744

--------------------------------------------------------------------------------

Query: SELECT userid,posts,username,joindate FROM user ORDER BY joindate DESC LIMIT 10
Time before: 0.20021605491638
Time after: 0.20625805854797

--------------------------------------------------------------------------------

Query: SELECT title,threadid,postusername,lastpost,lastposter,vi ews FROM thread ORDER BY lastpost DESC LIMIT 10
Time before: 0.20650804042816
Time after: 0.21807396411896

--------------------------------------------------------------------------------

Query: SELECT title,threadid,views FROM thread ORDER BY views DESC LIMIT 1
Time before: 0.21840500831604
Time after: 0.22928094863892

--------------------------------------------------------------------------------

Query: SELECT title,threadid,votenum FROM thread ORDER BY votenum DESC LIMIT 1
Time before: 0.22944295406342
Time after: 0.23878300189972

--------------------------------------------------------------------------------

Query: SELECT template FROM template WHERE title='10stat' AND (templatesetid=-1 OR templatesetid=10) ORDER BY templatesetid DESC LIMIT 1
Time before: 0.23892199993134
Time after: 0.24098205566406

--------------------------------------------------------------------------------

Query: SELECT template FROM template WHERE title='10stat' AND (templatesetid=-1 OR templatesetid=10) ORDER BY templatesetid DESC LIMIT 1
Time before: 0.24120497703552
Time after: 0.24231505393982

--------------------------------------------------------------------------------

Query: SELECT userid, username FROM user ORDER BY joindate DESC LIMIT 1
Time before: 0.24245095252991
Time after: 0.24784004688263

--------------------------------------------------------------------------------

Query: SELECT * FROM forum WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder
Time before: 0.24835503101349
Time after: 0.25652503967285

--------------------------------------------------------------------------------

Query: SELECT forumid,canview,canpostnew FROM forumpermission WHERE usergroupid='6'
Time before: 0.26244699954987
Time after: 0.26509296894073

--------------------------------------------------------------------------------

Query: SELECT user.userid,user.username,moderator.forumid
FROM moderator
LEFT JOIN user
ON (moderator.userid=user.userid)
ORDER BY user.username
Time before: 0.26525700092316
Time after: 0.26839196681976

--------------------------------------------------------------------------------

Query: SELECT COUNT(*) AS sessions FROM session WHERE userid=0 AND lastactivity>1058084624
Time before: 0.26860499382019
Time after: 0.27046096324921

--------------------------------------------------------------------------------

Query: SELECT COUNT(*) AS sessions FROM session WHERE userid>0 AND lastactivity>1058084624
Time before: 0.27054798603058
Time after: 0.27136194705963

--------------------------------------------------------------------------------

Query: SELECT DISTINCT session.userid,username,invisible,usergroupid
FROM session
LEFT JOIN user ON (user.userid=session.userid)
WHERE session.userid>0 AND session.lastactivity>1058084624
ORDER BY invisible ASC, username ASC
Time before: 0.27145004272461
Time after: 0.27346396446228

--------------------------------------------------------------------------------

Query:
SELECT findword, replaceword, replacementsetid
FROM replacement
WHERE replacementsetid IN(-1, '10')
ORDER BY replacementsetid, replacementid DESC

Time before: 0.32838904857635
Time after: 0.33497297763824

--------------------------------------------------------------------------------


Page generated in 0.3204300403595 seconds with 25 queries,
spending 0.19188046455383 doing MySQL queries and 0.12854957580566 doing PHP things.
Query: DELETE FROM session WHERE sessionhash='' Time before: 0.35468697547913 Time after: 0.35836505889893
--------------------------------------------------------------------------------
Query: UPDATE user SET lastactivity=1058085524,inforum='0' WHERE userid='157' Time before: 0.35857403278351 Time after: 0.36301898956299
--------------------------------------------------------------------------------

Erwin
07-13-2003, 10:15 AM
What's this query for:

SELECT template FROM template WHERE title='10stat'

I assume you have a top 10 stats hack running somewhere. If not, remove that query from your PHP file - the template is called twice for whatever reason, so you may have 2 identical code that needs to be removed.