![]() |
Optimizing Forumhome
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.... |
Thanks for releasing Xenon, I'm going to be sure to test this one :D
|
:)
i hope i'll get good results by you NTLDR :) |
Yea i'll test this one out - sounds awesome :P
|
Sounds good:)
Will install:) Satan |
I'm going to test it for my new site! Thanks Xenon!
|
i have to thank everyone who test it to bring back some feedback to me :)
if it works as it should i'll create other hack like that (have some ideas :)) @All: my PM-solution worked wrong (damn) the file is updated with the well known pm-query, you should use this instead :) |
This is great!
My queries used to be at 48, and now dropped to 38. I know this is extremely high, so are there any ways to lower it any more? |
Xenon, I did a re-fresh with 21 queries, it jumped to 23 and on another refresh, it went down to 17. I figure it was the cache kicking it. Its there a way to add this:
Code:
$totalviews=number_format($countthreads['views']); Also, the code for this: Code:
$numbersmembers=$DB_site->query_first('SELECT COUNT(*) AS users,MAX(userid) AS max FROM user'); |
Uploaded new version with small bugfix
be sure you also make the table change to have lastupdate in it :) Boofo: Well, yes it can be changed, if you use the threadtable instead of the forum-table, but the forumtable is faster, and on an unhacked vb229 i've used the optimized version :) once it's out of the beta i can make it for you or post it here ok? Quote:
Quote:
But the additional queries are very fast from what i know compared to the others :) |
I don't want it changed if it can be incorporate it into what you already have. It's just that i don't have any threadviews anymore. :)
I haven't changed anything there (that I can recall). Must be an extra space or something in my file. :) |
of course, because the threadviewpart was a hack wasn't it? :)
instead of this code: PHP Code:
PHP Code:
|
Thank you, sir. And I'm still at 17 queries. You are the Man! :)
I need to ask, though, is it normal to have this hack add 2 queries until the refresh? I mean, it is supposed to do that, right? By the way, the threadviews was more of a line of code I got from Chen than a hack. :) |
:)
yes it is normal :) as said above the two extra queries are fast one's but i can't exactly say the performance power, that's why it's here in beta :) :) |
Ok, well, I have noticed the page loads a lot quicker and smoother. So, it must be doing something. But, then, my board doesn't have very many users either, so I can't tell on the server load part of it. Although my server load stats in Microstats are showing 0.09, 0.05, 0.09 right now, if that means anything at all. :)
|
Page loads indeed quicker and it reduced the index queries by ten..that's significant! I hope that you can do this for the showthread. ;) Well done Xenon.
|
I went from 18queries to 13queries. Very nice.
|
Yes it works faster, but the downside is i just lost TECKS hack: Latest XX Threads on Forumhome Page. Is there a way to work arround it?
https://vborg.vbsupport.ru/showthrea...threadid=43310 |
@Aaron1: i'll look into it when i finished the beta, i'm still working on optimizing :)
@Boofo: Queries which are inside the makeforumbit function will be reduced always, so if someone has installed the show subforums hack, this hack can save an enourmous ammount of queries. it always depends on how strong your index.php is hacked :) well it's just the field lastupdate which has been included into the new version, it prevents some bugs... you don't have to upgrade immediatelly, because im sure i'll change the structure a bit soon ;) Wahh, sortingorder here is completly....... good it's just beta :) |
So installing the show sub-forums hack would now only add one query instead of all those queries in the query loop?
- miSt |
well, whenever the cache would be updated all queries of the subforumhack will be there again, but if the script reads out from the cache NO more quereis are added for the subforums :)
|
Quote:
Btw, a small note: the Latest XX topics Hack, sometimes disapears & appears again. Very strange... |
I see: the lates XX topics will appear everytime the cache is updated.
so you have to cut out the hack lines by Teck and put em after the } // if $cacheupdate line so it should work |
Great i will try right away! And it works!
Page generated in 1.36290896 seconds (40.29% PHP - 59.71% MySQL) with 20 queries. Now i notice that Latest XX Threads is just 1 querie, which isn't bad i guess... Thanks Xenon. Great stuff |
good to hear :)
|
Ok so any extra hacks we have installed which add lines which are db queries we need to put after the cache line?
|
Oops i got a database error, that looks like something to do with the cache forum home template...
Here's the beginning of the error message: Invalid SQL: INSERT INTO cache_forumhome (userid,lastpost,lastupdate,postcount,styleid, forumbits) VALUES (1251,1040492181,1040492253,5550,0,"</table> </td></tr></table><br> Here's the end: mysql error: Duplicate entry '1251' for key 1 mysql error number: 1062 Hmm, ok i attached the complete message as a txt file... Hope this helps :) I also checked in phpmyadmin the cache_forumhome table is about 1 mb large, and it grows. For your interest: i got a pretty busy board (almost 1000 visitors a day) |
I also checked in phpmyadmin the cache_forumhome table is about 1 mb large, and it grows. For your interest: i got a pretty busy board (almost 1000 visitors a day)
I think i understand: 1251 is a member on the board. Sorry for this, i am just starting to learn php/mysql a little bit. And i have the trouble of thinking out loud :) |
I recieved the same error message as Aaron1 above also, not sure what the problem is though but I'm guessing as well to do with the cache... :ermm:
|
hmm weird this should not happen and logically cant hapen, because all old caches are deleted before the new one is inserted......
maybe it's an mysql problem i try to solve it thanks for letting me know :) it seems it just appears when much users are online..... @mist: every hack which adds queries and is not saved in $forumbits must be below the cahcing if-clause :) |
go to phpmyadmin drop the index from the table and then run this one:
ALTER TABLE `cache_forumhome` ADD INDEX ( `userid` ) @Aaron: yes, the table will grow depending on your ammount of online users at the same time, but it should change dynamically, so it would also decrease after 5 hours again :) (you can try to change this value in the hack if you want :)) |
Quote:
Ps, i have no experience in dropping indexes, but dropping tables i have done before! Is that the same thing perhaps? |
it was for all of you
i think the index makes the problem you posted before :) no, droping indexes isn't the same as droping the table ;) but you can drop the whol table and recreate it again with the new install file, then it should work also :) |
Hehe, ok thanks! I will give it a try! :)
I will keep you informed... |
Just for incase of disaster, you can take a look at my phpmyadmin screendump. Let me know it it looks alright :)
|
looks as it should now :)
|
oh, sadistically as i am i've uploaded another new version now *gg*
it's just a small cahnge in the caching php-code but it can save a lot of db-space if you have instelled the zlib on your php-module if you install the new version be sure your empty the table before, if not the old format will be coruppted till the next cache update ;) |
I just checked with a simple phpinfo script:
ZLib Support enabled 'zlib:' fopen wrapper enabled Compiled Version 1.1.3 Linked Version 1.1.3 I seem to have it installed :) Thanks |
:)
then i'm sure it'll reduce the space used in DB a lot :) |
Installed! Looks ok by me, but i seem to use 1 querie more somehow. But that could 'i hope' fluctuate...
Page loaded in 1.86 seconds - 28.95% Php - 71.05% MySql with 21 queries. |
All times are GMT. The time now is 06:44 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|