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)
-   -   vbMicroStats: page load time, queries, GZIP and PHP version (https://vborg.vbsupport.ru/showthread.php?t=35811)

TECK 07-15-2002 04:31 PM

check your templates. the way is designed the hack, it will not interfere with any blocks.. due to {getmicrostats} variable. there are several users who installed this on phpportals without any problem.

X-Fan 07-15-2002 04:38 PM

Got it working now...

Page generated in 3.88498294 seconds (7.21% PHP - 92.79% MySQL) with 55 queries.

55 queries... ouch :(

How can I find out why there's so many queries and how to cut that number down?

TECK 07-15-2002 04:44 PM

first congrats on get it working... :)
second, hmm there are your hacks that generate alot of queries. i personally think 55queries is huge, extremly high. your server gets on the red line at 40-45queries.
phportals are known for adding alot of queries. unfortunatelly there is nothing you can do about it, unless you disable as many options as you can.
a decent number of queries should be 25.
that's the only reason i didnt install phpportals. the extreme no. of queries.

btw, did you know that vB3 will have only 12queries? :)

X-Fan 07-15-2002 04:56 PM

Which of the vbPortal options are we talking about, specifically?

(Just so I've got an idea of things I can try and reduce that huge number of queries!)

Gary King 07-15-2002 04:59 PM

@X-Fan: I just visited your forums, and got this:
Quote:

Page generated in 8.75267601 seconds (5.27% PHP - 94.73% MySQL) with 46 queries.
:eek::eek::eek:

TECK 07-15-2002 05:18 PM

Quote:

Originally posted by X-Fan
Which of the vbPortal options are we talking about, specifically?
(Just so I've got an idea of things I can try and reduce that huge number of queries!)

i have no idea. as i said, i never installed phpportals. i know about the options from other users who installed this hack and encountered the same prob as you.

Erwin 07-17-2002 01:22 AM

I got my forum index page down to 15 queries. :D That is less than default. And I have LOTS of hacks running.

TECK 07-17-2002 01:26 AM

that's a great job there erwin. you probably tied the 3 pm queries into one, on forumhome page, that will take it down to 15. :)
i wonder how many queries vb3 will have on showthread? that's the only place where we see the highest number of queries performed.

Erwin 07-17-2002 01:33 AM

My showthread has 18 queries - that is the bare minimum I can get it down to, without removing hacks I want.

X-Fan 07-17-2002 02:44 AM

So Erwin, how did you do it? Any advice for us PHP newbies?

Erwin 07-17-2002 06:14 AM

Make sure you include all your templates in the PHP file's templatesused=" " section. Each template called not in that section is one extra query.

Do a search for the word "query" in the file and then remove all queries that you can make do without. For example, I disabled invisibility, which means I can remove the queries for people browsing a forum etc. - it all adds up.

X-Fan 07-17-2002 06:48 AM

I did that for my forums/index.php and it only reduced the number of queries by two.

Boofo 07-17-2002 07:07 AM

How fo you tie those 3 queries together? Mind giving us the code to do it? :)

Quote:

Originally posted by Nakkid
that's a great job there erwin. you probably tied the 3 pm queries into one, on forumhome page, that will take it down to 15. :)
i wonder how many queries vb3 will have on showthread? that's the only place where we see the highest number of queries performed.


Boofo 07-17-2002 07:09 AM

What about the templates that don't always get used unless you link to it? Will including them hurt at all?

Quote:

Originally posted by Erwin
Make sure you include all your templates in the PHP file's templatesused=" " section. Each template called not in that section is one extra query.

Do a search for the word "query" in the file and then remove all queries that you can make do without. For example, I disabled invisibility, which means I can remove the queries for people browsing a forum etc. - it all adds up.


TECK 07-17-2002 08:18 AM

Quote:

Originally posted by Erwin
My showthread has 18 queries - that is the bare minimum I can get it down to, without removing hacks I want.
is impossible. a showthread have 22 queries. unless you removed certain functions, you cant have 18queries. and your hacks you have installed dont perform any queries.
a showthread have 18-19queries when is an empty thread (no threads posted in the last 30days). as soon as you post once, it pops to 22.

firefly (who i'm pretty sure he started slowly to implement on this board vb3 code technique) have it at 29queries.

TECK 07-17-2002 08:27 AM

Quote:

Originally posted by Boofo
How fo you tie those 3 queries together? Mind giving us the code to do it? :)

search the board. it was posted. or open a new thread in general hacking discussion.

Boofo 07-17-2002 08:59 AM

I figured I'd get that answer from you. I just wanted to make sure you would react that way. You've proven yourself once again, my friend. Some things never change :)

TECK 07-17-2002 09:09 AM

did you noticed that nobody is answering you related to your 'deviated from thread' questions? in any post? why do you think we have several forums here?
firefly, i have an idea: delete all the forums and make only one ok? "full releases".

and yes, i dont forget when someone is calling me a liar in public.

Boofo 07-17-2002 09:17 AM

Why don't you calm down, there, son? We all know how you get when you don't get your nap. :)

As far as being not on topic goes, if I remeber right, you brought it up in the first place when you basically called Erwin a liar.

And as far as you being called a liar, that was never actually said in the thread. But, then, you proved yourself when you added the fix from Neo to the file and kept the old version number on it. Do it once, do it again? :)

Firefly, did you catch that? He had an idea! Was it an original one, or someone else's rehash. Just curious. :)

Quote:

Originally posted by Nakkid
did you noticed that nobody is answering you related to your 'deviated from thread' questions? why do you think we have several forums here?
firefly, i have an idea: delete all the forums and make only one ok? "full releases".

and yes, i dont forget when someone is calling me a liar in public.


TECK 07-17-2002 09:21 AM

you make me smile when you call me son.
the discussion with erwin was not off topic because it didnt involved any extra hacking that does interfere with this hack. it's simple information related to users experience with the hack, since they are able to actually see the number of queries performed.

your request involved a different hack that have nothing to do with vbmicrostats.
as far as our personal issues, is off topic from this hack. if you have any issues, open a new thread or use pm or email.

Boofo 07-17-2002 09:28 AM

Then you might want to take your own advice and do the same in the future, when you start to ramble elsewhere in a thread. ;) And unless I missed something somewhere, I don't think you were made a moderator here, yet. If that sad day ever happens, I guess I'll have to "find a new place to dwell, uh-huh!" :)

'Nuff said. I'm done.

Quote:

Originally posted by Nakkid
you make me smile when you call me son.
and this is off topic from this hack. if you have any issues, open a new thread or use pm or email.


TECK 07-17-2002 09:35 AM

Quote:

Originally posted by Boofo
Then you might want to take your own advice and do the same in the future, when you start to ramble elsewhere in a thread...
np. i will pay attention to this. thanks.
so far i discussed only issues related to the specific thread, anywhere. btw, that's have nothing to do with being a moderator, is with being efficient. basically you save time if you do a search and if you dont find it, simply ask. people will answer you. i know i will, even if you dont believe it.
as for your query question, try this search: "tie pm query", you will be amased...

Boofo 07-17-2002 10:40 AM

Doesn't work. pm is only 2 letters. Thanks, anyway. :)

Quote:

Originally posted by Nakkid
as for your query question, try this search: "tie pm query", you will be amased...

TECK 07-17-2002 10:43 AM

i send you a pm with all the info you need.

Admin 07-17-2002 12:55 PM

Are we all friends again? Don't let it happen again.

Martin64 07-21-2002 01:45 PM

Seems like a very useful hack - I'll give it a shot. :)

Martin64 07-21-2002 02:26 PM

Installed and works like a charm :). This is probably the most useful hack I have on my boards, and I think a lot of fellow vBulletin owners agree with that, especially if they are using servers that are being pushed to their limits. This is perfect, now I can keep an eye on the server load and at the same time browse the boards. :D

TECK 07-21-2002 06:24 PM

martin64, i looked at your site and i noticed you didnt hacked properly the db_mysql.php file, that's why you have 100% and 0% values. please double check the steps in that file.

Martin64 07-21-2002 06:49 PM

Okay, thanks. I overwrote some files and had to re-add my 3 most recently added hacks so that's probably why I missed it. I don't know what went wrong, but I had to download the 2.2.6 package again and overwrite my old files. :hurt:

It was working earlier, I just hadn't noticed yet. Thanks once again. :D

Edit: fixed. :cool:

Erwin 07-21-2002 07:47 PM

Quote:

Originally posted by Nakkid
is impossible. a showthread have 22 queries. unless you removed certain functions, you cant have 18queries. and your hacks you have installed dont perform any queries.
a showthread have 18-19queries when is an empty thread (no threads posted in the last 30days). as soon as you post once, it pops to 22.

firefly (who i'm pretty sure he started slowly to implement on this board vb3 code technique) have it at 29queries.

Oh, I missed the last few juicy posts! ;)

It is possible, but only if you remove a few standard features.

I took out invisibility (that's 1), and forumjump (that's 2). The hacks in my showthread did not do queries.

Since then though, I have moved servers, and with a faster server I have put back forumjump, and reinstalled who is browsing this thread. I also reinstalled the "Users Online in Header".

This has brought my showthread back up to 23. (Page generated in 1.00907195 seconds (67.16% PHP - 32.84% MySQL) with 23 queries.)

My index is now at 17 queries. (Page generated in 0.29747605 seconds (82.73% PHP - 17.27% MySQL) with 17 queries.) - I did this by combining the PM queries, removing the query to count threads (I only display posts), and also keeping invisibility off. But using the "Users Online in Header" adds an extra 2 queries to every page.

Erwin 07-21-2002 07:49 PM

Oh yeah, I disabled forum access masks as well, and made the "Who's Online" page only for admins to prevent the private forum bug.

KuraFire 07-22-2002 10:34 AM

I haven't been keeping up with this thread for a while, but I noticed a 'flaw' in this hack that is rather scary...

When I installed it (just after the 226 db_mysql.php came out) it didn't add the $query_count var. to the query_first function. The Query_first function is, however, as the name implies, another function using queries, and all these queries were omitted since there was no global $query_count and $query_count++; part palced in it. If you do, you'll suddenly notice how much queries are added. On my board, the count went up with an average of 15 queries. Those are all queries with limit 1 (the query_first function) but still queries. I don't think that's a very good thing....

I'm probably missing out on some info here, but to me, that seems bad. Showthread pages now have a standard of 46 queries on average, with a few 1-query hacks installed.... :/

KuraFire 07-22-2002 03:43 PM

btw...

Is it me, or is it rather silly that Invisibility (I assume this is the normal feature that says whether a user is displayed as logged in or invisible (guest) ?) is something that doesn't require an independant query at all?

I really don't see why that feature requires its own query to be enabled. Someone please explain?

TECK 07-22-2002 04:27 PM

Quote:

Originally posted by KuraFire
I haven't been keeping up with this thread for a while, but I noticed a 'flaw' in this hack that is rather scary...

When I installed it (just after the 226 db_mysql.php came out) it didn't add the $query_count var. to the query_first function. The Query_first function is, however, as the name implies, another function using queries, and all these queries were omitted since there was no global $query_count and $query_count++; part palced in it. If you do, you'll suddenly notice how much queries are added. On my board, the count went up with an average of 15 queries. Those are all queries with limit 1 (the query_first function) but still queries. I don't think that's a very good thing....

I'm probably missing out on some info here, but to me, that seems bad. Showthread pages now have a standard of 46 queries on average, with a few 1-query hacks installed.... :/

this hack doesnt add any query, it only give you the opportunity to see what it's happening behing php and mysql, on every page. it's doing this by only using the microtime function built in php. the rest of functions are used as default by vbulletin.

here it is an example of the original db_mysql.php:
Code:

  function query($query_string) {
    global $query_count,$showqueries,$explain,$querytime;
    // do query

as you notice, $query_count is present there, in the original file. the only mods i did is to allow to insert the microtime at the beginning and end of page so i can see exacly the time it took to generate the page.
i recommend you to download the latest vb226 package from members area and look at the db_mysql.php file. then to modify it properly. there have been several versions of this file and my hack includes instructions with the latest downloadable .zip file from members area.
also, i dont see where you added query_first string, because is not required in my hack.

at no time you will see 15queries added. this is related to other hacks you added, not vbMicroStats.

KuraFire 07-22-2002 06:40 PM

Nakkid, was my post that unclear to you???

I Never said that it was this hack that added queries. Nowhere. I was talking about the QUERY_FIRST function of vBulletin itself that adds queries, but with this hack all those queries were omitted from the variable $query_count, therefore the number displayed at the bottom in the microstats - this hack allowing for that to be seen - is actually quite a lot higher (15 queries higher on average) than you get with the default install of this hack (last I checked the install instructions, that is).

There are TWO functions in vBulletin to do a query, and your hack counted only the queries done by ONE of them, therefore at the bottom where it says "with XX queries" the number was wrong, by a shocking 15 on average, which are all the queries done by vBulletin's QUERY_FIRST function.

Are you getting this, now? :/

Admin 07-22-2002 07:15 PM

Quote:

Originally posted by KuraFire
Nakkid, was my post that unclear to you???

I Never said that it was this hack that added queries. Nowhere. I was talking about the QUERY_FIRST function of vBulletin itself that adds queries, but with this hack all those queries were omitted from the variable $query_count, therefore the number displayed at the bottom in the microstats - this hack allowing for that to be seen - is actually quite a lot higher (15 queries higher on average) than you get with the default install of this hack (last I checked the install instructions, that is).

There are TWO functions in vBulletin to do a query, and your hack counted only the queries done by ONE of them, therefore at the bottom where it says "with XX queries" the number was wrong, by a shocking 15 on average, which are all the queries done by vBulletin's QUERY_FIRST function.

You are the one that is confused.

If you had taken the time to actually look at the query_first() method you would see that it calls query() itself. What you did was count all the query_first() queries twice.

Look:
Code:

  function query_first($query_string) {
    // does a query and returns first row
[high]    $query_id = $this->query($query_string);[/high]
    $returnarray=$this->fetch_array($query_id, $query_string);
    $this->free_result($query_id);
    return $returnarray;
  }


KuraFire 07-22-2002 08:09 PM

I wasn't confused, I was just uncertain that what I thought was actually how vB worked, which, thankfully, isn't the case.

Nakkid totally didn't get my post up there, but that may well be cos he already knew about that. (notice how I asked for clarity on this thing in my first post on this page? :))

thx btw for that :up:

Boofo 07-22-2002 08:37 PM

What private forum bug? :)

Quote:

Originally posted by Erwin
Oh yeah, I disabled forum access masks as well, and made the "Who's Online" page only for admins to prevent the private forum bug.

Erwin 07-23-2002 02:21 AM

Quote:

Originally posted by Boofo
What private forum bug? :)


It's discussed in vbulletin.com

Basically if you switch off forum access mask, members can look at the titles of threads in a private forum if a staff member is reading the thread by lookin at the Who's Online page. (At least on my site and a few others).

jassim 07-23-2002 07:02 AM

ok i want last vr for this hacks :)

thankx


All times are GMT. The time now is 06:32 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.01959 seconds
  • Memory Usage 1,843KB
  • 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
  • (2)bbcode_code_printable
  • (15)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (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