The Arcive of vBulletin Modifications Site. |
|
|
#1
|
||||
|
||||
|
Quote:
Also, before upgrading I was getting 97% PHP and 3% mysql .. now the sql percent doubled.. Can someone explain why is this? |
|
#2
|
||||
|
||||
|
haven't looked at the vb229 code yet, perhaps something has been optimized....
Also: there are many methods out to reduce queries, try to search pm-queries total threads/posts and so on. also if you don't want some things, you can reduce queries to, also with large hacked boards
|
|
#3
|
||||
|
||||
|
Thanks Xenon, I enabled debug mode to see queries.. vbproarcade is adding 3 queries to forum home when there isn't even anything vbproarcade related on forum home..
I have to asks Mr. vbproarcade aranoid: Quote:
|
|
#4
|
||||
|
||||
|
you can reduce the query ammount by adding vbproarcade_gamelinkbit and vbproarcade_gamelinks to the $templatesused variable
|
|
#5
|
||||
|
||||
|
sorry am a newbie, can you explain how?
|
|
#6
|
||||
|
||||
|
in your index.php you'll find something like that:
Code:
$templatesused='forumhome_birthdaybit,error_nopermission,forumhome_pmloggedin,forumhome_welcometext,forumhome_logoutcode,forumhome_newposts,forumhome_todayposts,forumhome_logincode,forumhome_loggedinuser,forumhome_loggedinusers,forumhome_lastpostby,forumhome_moderator,forumhome_forumbit_level1_nopost,forumhome_forumbit_level1_post,forumhome_forumbit_level2_nopost,forumhome_forumbit_level2_post,forumhome,forumhome_unregmessage'; |
|
#7
|
||||
|
||||
|
Make sure all templates being eval() are cached in $templatesused in all your php files.
That helps.
|
|
#8
|
||||
|
||||
|
Thanks guys, I am down from 21 queries to 18, I am trying to go lower, lol .. how does this look? just trying to make sure nothing is looping :P
is it bad if I keep debug=1 in config.php so I could keep an eye on this page when I feel the need? or is there another easy method? Code:
Query: SELECT template FROM template WHERE title='options'
Time before: 0.15240097045898
Time after: 0.15558695793152
--------------------------------------------------------------------------------
Query: SELECT sessionhash,userid,host,useragent,styleid FROM session WHERE lastactivity>1037764842 AND sessionhash='c9f334daa0620212783908c9197b180f' AND (host='68.63.161.176' OR (althash='' AND althash<>'')) AND useragent='Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;'
Time before: 0.19247901439667
Time after: 0.19490694999695
--------------------------------------------------------------------------------
Query: SELECT user.*,userfield.* FROM user LEFT JOIN userfield ON userfield.userid=user.userid WHERE user.userid='1'
Time before: 0.19714498519897
Time after: 0.20041298866272
--------------------------------------------------------------------------------
Query: SELECT templatesetid,replacementsetid,userselect FROM style WHERE styleid='1'
Time before: 0.20493304729462
Time after: 0.20647895336151
--------------------------------------------------------------------------------
Query: SELECT template,title
FROM template
WHERE (title IN ('forumhome_birthdaybit','error_nopermission','forumhome_pmloggedin','forumhome_welcometext','forumhome_logoutcode','forumhome_newposts','forumhome_todayposts','forumhome_logincode','forumhome_loggedinuser','forumhome_loggedinusers','forumhome_lastpostby','forumhome_moderator','forumhome_forumbit_level1_nopost','forumhome_forumbit_level1_post','forumhome_forumbit_level2_nopost','forumhome_forumbit_level2_post','forumhome','forumhome_unregmessage','vbproarcade_gamelinkbit','vbproarcade_gamelinks','gobutton','timezone','username_loggedout','username_loggedin','phpinclude','headinclude','header','footer','forumjumpbit','forumjump','nav_linkoff','nav_linkon','navbar','nav_joiner','pagenav','pagenav_curpage','pagenav_firstlink','pagenav_lastlink','pagenav_nextlink','pagenav_pagelink','pagenav_prevlink','home_microstats')
AND (templatesetid=-1 OR templatesetid=4))
OR (title = 'maxloggedin')
OR (title = 'birthdays')
ORDER BY templatesetid
Time before: 0.20853698253632
Time after: 0.23826396465302
--------------------------------------------------------------------------------
Query: SELECT * FROM usergroup WHERE usergroupid=6
Time before: 0.27794396877289
Time after: 0.28122901916504
--------------------------------------------------------------------------------
Query: SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=1
Time before: 0.28548502922058
Time after: 0.28720498085022
--------------------------------------------------------------------------------
Query: SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=1 AND dateline>1037749782 AND folderid=0
Time before: 0.28879702091217
Time after: 0.29008603096008
--------------------------------------------------------------------------------
Query: SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=1 AND messageread=0 AND folderid=0
Time before: 0.29159295558929
Time after: 0.29285097122192
--------------------------------------------------------------------------------
Query: SELECT COUNT(*) AS users,MAX(userid) AS max FROM user
Time before: 0.30035698413849
Time after: 0.30172097682953
--------------------------------------------------------------------------------
Query: SELECT COUNT(*) AS posts FROM post
Time before: 0.303297996521
Time after: 0.30426096916199
--------------------------------------------------------------------------------
Query: SELECT COUNT(*) AS threads FROM thread
Time before: 0.30569303035736
Time after: 0.30717396736145
--------------------------------------------------------------------------------
Query: SELECT userid,username FROM user WHERE userid=24
Time before: 0.30870699882507
Time after: 0.31004095077515
--------------------------------------------------------------------------------
Query: SELECT * FROM forum WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder
Time before: 0.31353199481964
Time after: 0.31699800491333
--------------------------------------------------------------------------------
Query: SELECT forumid,canview,canpostnew FROM forumpermission WHERE usergroupid='6'
Time before: 0.32239699363708
Time after: 0.32396697998047
--------------------------------------------------------------------------------
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.3255490064621
Time after: 0.32686197757721
--------------------------------------------------------------------------------
Query: SELECT COUNT(*) AS sessions FROM session WHERE userid=0 AND lastactivity>1037764843
Time before: 0.32852005958557
Time after: 0.3303279876709
--------------------------------------------------------------------------------
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>1037764843
ORDER BY invisible ASC, username ASC
Time before: 0.3318909406662
Time after: 0.33439099788666
--------------------------------------------------------------------------------
Query: SELECT findword,replaceword FROM replacement WHERE replacementsetid IN(-1,'4') ORDER BY replacementsetid DESC,replacementid DESC
Time before: 0.45747303962708
Time after: 0.46432197093964
--------------------------------------------------------------------------------
Page generated in 0.4018360376358 seconds with 19 queries,
spending 0.070354580879211 doing MySQL queries and 0.33148145675659 doing PHP things.
Query: UPDATE session SET lastactivity=1037765742,location='/forums/index.php?s=&showqueries=1' WHERE sessionhash='c9f334daa0620212783908c9197b180f' Time before: 0.5302209854126 Time after: 0.53218805789948
--------------------------------------------------------------------------------
Query: UPDATE user SET lastactivity=1037765742,inforum='0' WHERE userid='1' Time before: 0.53371500968933 Time after: 0.53505504131317
--------------------------------------------------------------------------------
|
|
#9
|
|||
|
|||
|
Super noob here, what is the debug=1 in config.php? I would like to try that.
:banana: |
|
#10
|
||||
|
||||
|
debug allows you to troubleshoot problems or when your trying to optimize things like me
![]() in admin/config.php add $debug=1; on a new line, then go to your forums and on the page you want to debug add: &showqueries=1 or &explain=1 to the url .. for example, if you want to see the queries being performed in forum home you're url should look like: /forums/index.php?s=&showqueries=1 don't forget to remove it from the config once your done. |
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|