Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Optimizing Forumhome Details »»
Optimizing Forumhome
Version: 1.00, by Xenon Xenon is offline
Developer Last Online: Oct 2023 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 12-19-2002 Last Update: Never Installs: 94
 
No support by the author.

Ok, what this Hack does is it reduces the ammount of queries on forumhome by caching the moderatorlist and by optimizing most of the queries used on index.php


I'd really appreciate getting feedback how it reduces serverload on greater boards

On an unhacked vb index.php (pm enabled accesmask disabled) it reduces the ammount of queries from 19 to 15
my experiments have shown, that the queries are faster than the normal ones, too....

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #197  
Old 03-04-2003, 07:09 PM
Xyphen's Avatar
Xyphen Xyphen is offline
 
Join Date: Dec 2002
Location: ON, Canada
Posts: 370
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the tip, but I am not quite good at php as you are.
Reply With Quote
  #198  
Old 03-04-2003, 07:20 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well, also i started from a not so experienced level
with time you'll learn how to do these things

i'd help you, but i really don't have any time left these days.
Reply With Quote
  #199  
Old 03-04-2003, 07:47 PM
VeoMorphine VeoMorphine is offline
 
Join Date: Nov 2002
Posts: 155
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

whoa..... Dramatic change for me. Very Very Very good hack indeed.
Reply With Quote
  #200  
Old 03-04-2003, 10:23 PM
Roderik Roderik is offline
 
Join Date: Sep 2002
Location: Belgium
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Before:
Code:
Page generated in 0.50040603 seconds (27.94% PHP - 72.06% MySQL) with 27 queries.
[Debug Mode OFF] [PHP v4.1.2] [GZIP enabled - level 9] [Server Load: 0.08 ? 0.17 : 0.22]
After:
Code:
Page generated in 0.51396000 seconds (26.39% PHP - 73.61% MySQL) with 23 queries.
[Debug Mode OFF] [PHP v4.1.2] [GZIP enabled - level 9] [Server Load: 0.22 ? 0.13 : 0.16]
a full 4 queries! a great improvement for a few changed lines!
MORE MORE!
Reply With Quote
  #201  
Old 03-05-2003, 06:53 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thx, i do what i can to find some more

btw. you should reduce your gzip level from 9 to 1.
the 9 isn't so much better in compressing, but the load of a server increases.
Reply With Quote
  #202  
Old 03-21-2003, 04:02 PM
Kars10's Avatar
Kars10 Kars10 is offline
 
Join Date: Jun 2002
Location: Germany/Franken
Posts: 748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

First of all this hack works great for me!!
Thanks Xenon.
But i have a problem with my $forum[moderators]. This variable is not working for me anymore.

I have deleted this code:

PHP Code:
$imodcache = array();
$mod = array();
$forummoderators=$DB_site->query('SELECT user.userid,user.username,moderator.forumid
                                  FROM moderator
                                  LEFT JOIN user
                                    ON (moderator.userid=user.userid)
                                  ORDER BY user.username'
);
while (
$moderator=$DB_site->fetch_array($forummoderators)) {
  
$imodcache["$moderator[forumid]"][] = $moderator;
  
$mod["$moderator[userid]"] = 1;
}
$DB_site->free_result($forummoderators);
unset(
$moderator); 
When i put the moderator-code back in my index.php i have my moderators showing up, but all with a >> , << comma bevor there names (examble: , xxx, xxx).
What can i do to make the moderators work.

Thanks in advance.
Reply With Quote
  #203  
Old 03-21-2003, 04:05 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

have you run the last step and modified a forum from your acp to initialise the Mod cache?
Reply With Quote
  #204  
Old 03-21-2003, 04:33 PM
Kars10's Avatar
Kars10 Kars10 is offline
 
Join Date: Jun 2002
Location: Germany/Franken
Posts: 748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes i have, and my mods are cached in the DB
Reply With Quote
  #205  
Old 03-21-2003, 04:37 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

then they should also be displayed!

the var is filled, that's why all other mods are added with a , in front to it.

maybe you have an disturbing hack installed which doesn't like mine ^^
i know your complicated index.php
Reply With Quote
  #206  
Old 03-21-2003, 04:42 PM
Kars10's Avatar
Kars10 Kars10 is offline
 
Join Date: Jun 2002
Location: Germany/Franken
Posts: 748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No way buddy...my index works!!
But what could it be that this variable don?t work anymore??
I promise, when i put the orginal mod-code back in the file, it works like a charm (but than i get that wierd comma)...
Reply With Quote
  #207  
Old 03-21-2003, 04:56 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well i know the hack works, and as it used the variable correct, it should show up

so it must be your index.php, and no i don't have time to take a closer look at your file
Reply With Quote
  #208  
Old 03-22-2003, 03:46 PM
AlexanderT's Avatar
AlexanderT AlexanderT is offline
 
Join Date: Mar 2003
Posts: 294
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't really know, but most of you guys only speak of reducing queries, but not total page generation time (see here: https://vborg.vbsupport.ru/showthrea...243#post361243)

I installed the hack and got the following timings:

WITHOUT Hack:
Page generated in 0.12671995 seconds (70.49% PHP - 29.51% MySQL) with 30 queries.
[Debug Mode OFF] [PHP v4.3.1] [GZIP enabled - level 1] [Server Load: 0.33 ? 0.55 : 0.87]


WITH Hack:
Page generated in 0.23996496 seconds (37.26% PHP - 62.74% MySQL) with 26 queries.
[Debug Mode OFF] [PHP v4.3.1] [GZIP enabled - level 1] [Server Load: 0.33 ? 0.55 : 0.87]


... So yes, queries were reduced by a lot, but total page generation took almost twice as long. So I assume the hack doesn't really do it for me.
Reply With Quote
  #209  
Old 03-23-2003, 04:30 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i hope you have run those test a bit more often than just once did ya?

i've tested it several times and the gen time was in average 80% of the old gen time.

of course if you just look on the time once it could happen that the time differences so much.
Reply With Quote
  #210  
Old 03-23-2003, 04:41 PM
AlexanderT's Avatar
AlexanderT AlexanderT is offline
 
Join Date: Mar 2003
Posts: 294
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yup I did... one entire evening testing. Query time was always below non-hack, but final page generation was above. I think the replacement of the pm query routine took most additional time.
Reply With Quote
  #211  
Old 03-23-2003, 05:01 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm, could i have some stats of you board?
post ammount, thread ammount, total pm ammount(and the ammount of pm's you have had in your account while testing)...

especially the pm ammount would be important, in version1 i know it was slower when there are a lot of pm's of a user that for this user the generation was slower, but for the average users who doesn't have much pm's it was faster.

normally all other queries should be faster than the original ones.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:37 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08623 seconds
  • Memory Usage 2,362KB
  • Queries Executed 30 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (16)post_thanks_box
  • (16)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (16)post_thanks_postbit_info
  • (15)postbit
  • (16)postbit_onlinestatus
  • (16)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete