vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Optimizing Forumhome (https://vborg.vbsupport.ru/showthread.php?t=46848)

nuno 01-04-2003 06:54 PM

Try to increase memory_limit value in php.ini.

Martin CX 01-04-2003 07:00 PM

Shouldn't 8 megs be enough?

nuno 01-04-2003 07:19 PM

Quote:

Originally posted by Martin CX
It worked fine for some hours, then this:

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 4081664 bytes) in .../index.php on line 408

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 45 bytes) in .../admin/db_mysql.php on line 77


Any ideas?

Increase it to 16M

pawel 01-06-2003 07:28 PM

Amazing hack! My page loaded very slow at peak times but now that problem is gone.
Thanks,
Paul

Xenon 01-06-2003 07:44 PM

:)
i enjoy to hear that :)

N9ne 01-19-2003 11:23 AM

So in this hack, data is being stored in the DB...by how much is my DB size going to increase?

Xenon 01-19-2003 11:29 AM

it's just stored in the DB temporairly, so not real increase of space is there...

Also it depends if you have zlib or not..

N9ne 01-19-2003 11:41 AM

How can I check if I have Zlib? Phpinfo?

edit: Just checked phpinfo and I have this:

--with-zlib'

So what does zlib do?

Xenon 01-19-2003 12:32 PM

with the zlib you should be able to use the compressing function gzdeflate and so on, which has a strong effect on the temp. db size which is needed by my hack :)

N9ne 01-19-2003 07:29 PM

And what is this about hacks not working with this one? I have a few hacks on forumhome, and one of them is # of users browsing in each forum :(

Erwin 01-20-2003 10:02 AM

I just saw this hack... Nice work, Stefan as always. :)

Tony G 01-20-2003 10:38 AM

I heard about this one, good job too! :D

Xenon 01-20-2003 02:32 PM

thx both of you :)

@N9ne: well you have to decide what is more important to you, some (not needed in my opinion) hacks or performance.
If you have a lot of users online same time, you should decide for performance, but, if you have just a few users, you can use your hacks.
Also most of the hacks can be combined with this hack if you have good experience in hacking, but some cannot like the # online...

N9ne 01-20-2003 03:58 PM

Well the hacks are very important to me/my members...

At peak times I have about 40-50 users online so I should be alright...I was just looking forward to seeing the query count drop 5 :D but unfortunately I cannot sacrifice hacks...

Xenon 01-20-2003 07:28 PM

well, your decicion :)

you can at least install the other querie opts like pm-query and thread ammount thing..

N9ne 01-20-2003 09:09 PM

I already did Xenon ;). PM Query mod I did about 4 months ago, and the thread/post counter I PMed you about and you helped me out on that too...

I have another board though, and it only has one, yes ONE! hack on forumhome, the change style drop down menu, so what do I need to do to get this to work with your mega-query reducer?

Xenon 01-21-2003 01:18 PM

well, the styledropdown hack should work with my hack without any problems as far as i know the hack :)

Schorsch 01-24-2003 10:29 PM

Hi Xenon,

I got a very rare error, it suddenly appears and it suddenly disappears (after pressing F5 in IE6):

Buffer Error

In line 487 is your piece of code:

Code:

if($cacheupdate) {
  $forumbits=makeforumbit(intval($forumid), 1, $permissions);
  if ($bbuserinfo['userid'] > 0 or ($ourtimenow - $bbuserinfo['lastvisit']) < $cookietimeout) {
    // remove old cache from user and those which are older than 5 hours
    $DB_site->query('DELETE FROM cache_forumhome WHERE userid=' . $bbuserinfo[userid] . iif($numbersmembers['lastpost']>(time()-3600*5), ' OR lastpost<'.(time()-3600*5),''));
    $DB_site->query('INSERT INTO cache_forumhome (userid,lastpost,lastupdate,postcount,styleid,forumbits) VALUES (' . $bbuserinfo[userid] . ',' . $numbersmembers[lastpost] . ',' . time() . ',' . $counters[posts] . ',' . $bbuserinfo[styleid] . ',"' . addslashes(gzdeflate($forumbits,9)) . '")');       
  }
} else {
  $forumbits=gzinflate($forumhomecache['forumbits']);    // <<<< LINE 487
}

I have 2 members who reported me this error, and 5 minutes ago I got the same error (for the first time) for about 1 minute.

Do you have any advice ?

thanks,
Schorsch

squawell 01-25-2003 03:51 AM

HI Xenon......

when i installed this but i have a problem

i cant logout.....and just only userid=1 cant....why??

so i replace original index.php file and it work.....

so Xenon what cause that??

Xenon 01-25-2003 11:01 AM

@Schorsch: well, it's a problem with your server, maybe the buffer is to small or something like that.

it's nothing i could repair ...

@Squawell: hmm, couldn't be normally the login/out feature are not touched by my hack.
Also it works perfect for all.
maybe you've changed the index on a piece of code where you shouldn't..

collidation with another hack you've installed propably?

squawell 01-25-2003 11:52 AM

Quote:

Originally posted by Xenon
@Squawell: hmm, couldn't be normally the login/out feature are not touched by my hack.
Also it works perfect for all.
maybe you've changed the index on a piece of code where you shouldn't..

collidation with another hack you've installed propably?

in fact...it not just effect the login function.. when i add or edit the new forum the main page also didnt show up too(the change part).....so strange...it only happen to userid=1 user.....i try another user account its normal and work perfect.....so that make me confuse what cause that??

by the way i dont change anything in index.php i use the original index.php......

Xenon 01-25-2003 12:05 PM

maybe your cookie is corrupted.
i know it can't happen because the part of code is not affected by my hack, at least not if you've done everything correct.

the last thing is normal, whenever you add or edit a forum on forumhome or add a moderator or something like that, it will just change after the cache has been updated, so whenever one new post has been made.

N9ne 01-25-2003 01:03 PM

I had a problem with this hack, when we were editing some templates for forumhome, they weren't updating on forumhome, so you can't see the changes, and when someone could see the changes, someone else couldn't...all in all I couldn't risk any problems and I just uninstalled the caching part of the hack..

Xenon 01-25-2003 04:42 PM

@N9ne: It's not a problem.
all you have to do after editing a template on forumhome is to make a new post and then all caches would be updatet...

you could also edit templates.php to manually delete all cached versions whenever you make a templateedit.

As said, it's not a problem, it's just how caching works without to rewrite hundreds of files ;)

pwr_sneak 02-02-2003 02:50 PM

i just read your instructions to see if this hack would work for my forum.
but this query is much slower then the original ones:
PHP Code:

SELECT COUNT(*) AS messages,
SUM(IF(dateline>$bbuserinfo[lastvisit] AND folderid=0,1,0)) AS newpm,
SUM(IF(messageread=AND folderid=0,1,0)) AS unreadpm
FROM privatemessage WHERE userid
=$bbuserinfo[userid$ignoreusers 

you replaced three fast queries which reads the values from index by one slow query which crawls through the whole datafile. i did a quick test on my privatemessage table (1.2M messages), your query took 2.2 seconds to complete, the original ones took 0.2 seconds all together

but the rest of this cache looks good :)

Boofo 02-02-2003 03:38 PM

Is there any way to make the one query faster?

pwr_sneak 02-02-2003 04:00 PM

I've updated my last post due to an cut'n'paste error...

Quote:

Originally posted by Boofo
Is there any way to make the one query faster?
you have to run the original 3 queries to make it faster.
it's a good idea trying to decrease the number of queries, but it won't help anything if you replace some small and fast queries with one big and slow query.

nuno 02-02-2003 04:23 PM

Quote:

Originally posted by pwr_sneak
I've updated my last post due to an cut'n'paste error...


you have to run the original 3 queries to make it faster.
it's a good idea trying to decrease the number of queries, but it won't help anything if you replace some small and fast queries with one big and slow query.

Read this thread
https://vborg.vbsupport.ru/showthrea...threadid=38471
Also read this post made by Chen
https://vborg.vbsupport.ru/showthrea...638#post254638
Also read Matt's post <- This guy is a db Master BTW. :D
https://vborg.vbsupport.ru/showthrea...690#post254690

pwr_sneak 02-02-2003 05:25 PM

Quote:

Originally posted by nuno

Read this thread
https://vborg.vbsupport.ru/showthrea...threadid=38471
Also read this post made by Chen
https://vborg.vbsupport.ru/showthrea...638#post254638
Also read Matt's post <- This guy is a db Master BTW. :D
https://vborg.vbsupport.ru/showthrea...690#post254690

Matt runs Sybase instead of MySQL, you can't compare this.
MySQL optimizes count(*) queries because it keeps an extra counter in its index-files when using MyISAM Tables. The Index should be read from RAM on heavy-used tables. This kind of queries as well as MAX(indexed-column) can be answered without I/O which makes it really fast.

this sum(...,1,0) trick has to read every row from the table or just every entry in its index if its condition matches from index. so this is always slower than reading three single values with three single queries.

nuno 02-02-2003 05:42 PM

Quote:

Originally posted by pwr_sneak

Matt runs Sybase instead of MySQL, you can't compare this.
MySQL optimizes count(*) queries because it keeps an extra counter in its index-files when using MyISAM Tables. The Index should be read from RAM on heavy-used tables. This kind of queries as well as MAX(indexed-column) can be answered without I/O which makes it really fast.

this sum(...,1,0) trick has to read every row from the table or just every entry in its index if its condition matches from index. so this is always slower than reading three single values with three single queries.

Quote:

Originally posted by FireFly
I did that Matt. :)

PHP Code:

  $allpm=$DB_site->query_first("SELECT COUNT(*) AS messages,
                                SUM(IF(dateline>
$bbuserinfo[lastvisit] AND folderid=0,1,0)) AS newpm,
                                SUM(IF(messageread=0 AND folderid=0,1,0)) AS unreadpm
                                FROM privatemessage WHERE userid=
$bbuserinfo[userid] $ignoreusers");

  
$newpm['messages']=$allpm['newpm'];
  
$unreadpm['messages']=$allpm['unreadpm']; 

Well I copied it from somewhere, don't really remember right now. But the problem is the query is slower for users with lots and lots of PM's (like myself), but considering most people don't I thought it would be wiser to just use that one query.

Chen already said one query is slower, however, this only occurs when you have a considerable amount of PM's stored.
So, i think your assumption is not correct.
It is faster for users with few pm's.

pwr_sneak 02-02-2003 06:25 PM

Quote:

Originally posted by nuno

Chen already said one query is slower, however, this only occurs when you have a considerable amount of PM's stored.
So, i think your assumption is not correct.
It is faster for users with few pm's.

where's the threshold of this considerable amount?
I do like those well scaling solutions more than those with unneccesary performance breaks.

I just wanted to say that it's not always good to run less queries than others do.

Maybe someone could figure out how many PMs are needed to make this one query slower than the original three.
My Database stores 1.3 million PMs and as I said before, the three queries are faster by factor 6 - 8

nuno 02-02-2003 07:07 PM

Quote:

Originally posted by pwr_sneak

where's the threshold of this considerable amount?
I do like those well scaling solutions more than those with unneccesary performance breaks.

I just wanted to say that it's not always good to run less queries than others do.

Maybe someone could figure out how many PMs are needed to make this one query slower than the original three.
My Database stores 1.3 million PMs and as I said before, the three queries are faster by factor 6 - 8

Exactly. :)
I would like to know this as well.:)

Xenon 02-02-2003 07:11 PM

you are right here, it would be intresing to find out how much pm's are needed to slow down...

in all my tests the one query was faster, but i never had 1,3 million pm's which i think most of the admins won't have....
If you have such a great db and board the optimization is to diasble pm-queries at all...

pwr_sneak 02-02-2003 07:58 PM

Quote:

Originally posted by Xenon
If you have such a great db and board the optimization is to diasble pm-queries at all...
the 3 pm-queries on index.php run 0.0068 seconds on my servers. no matter how huge the privatemessage table is since mysql doesn't have to read anything from disk or crawl through big B-Trees.

Seby 02-05-2003 02:45 PM

Vieln Dank Xenon!! ;)

Great Hack, now I only have 17 queries on my main page, nice!!

mcyates 02-06-2003 09:55 AM

my queries where 63, they are now 19

Xenon 02-06-2003 05:52 PM

:)
it's a good feeling and also a good motivation to get so much feedback, mainly positiv :)

i'm currently planing v2 of this hack, which will strongly optimize it, i hope it will be finished in two weeks

Buddha 02-15-2003 04:14 PM

33 to 23 querries.

thank you very much.

Seby 02-17-2003 01:06 PM

Xenon, seems that this hack doesnt work with version 2.3.0 :(
I installed it and then the forums homepage doesnt load, please have a look at it, the hack is great and I want to use it on my 2.3.0 board ;)

PS: Cheers again for helpng me Saturday! :D

Xenon 02-17-2003 05:07 PM

You're welcome seby :)

Hmm unfortunately, i don't have much free time, so i think i can't work on a new version of the hack.
Haven't taken a look at 230 yet.....

But i'll try to do what i can :)


All times are GMT. The time now is 04:06 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
  • Page Generation 0.02897 seconds
  • Memory Usage 1,841KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete