Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-03-2004, 06:57 AM
mcyates mcyates is offline
 
Join Date: Jan 2003
Location: Middlesbrough, Cleveland
Posts: 798
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Problem (82.09% PHP - 17.91% MySQL)

Page generated in 1.46836209 seconds (82.09% PHP - 17.91% MySQL) with 16 queries.

Shouldn't the MySQL be working more than the PHP? It used to be the other way round, but yesterday I was removing hack which were installed to reduce the amount of qeries with the server is putting towards MySQL.

Any Help you be appreciated
Reply With Quote
  #2  
Old 12-03-2004, 07:58 AM
Oblivion Knight's Avatar
Oblivion Knight Oblivion Knight is offline
 
Join Date: May 2002
Location: Sheffield, UK
Posts: 1,757
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, PHP loading is MUCH better (and friendlier) than SQL..
Reply With Quote
  #3  
Old 12-03-2004, 03:39 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mcyates
Page generated in 1.46836209 seconds (82.09% PHP - 17.91% MySQL) with 16 queries.

Shouldn't the MySQL be working more than the PHP? It used to be the other way round, but yesterday I was removing hack which were installed to reduce the amount of qeries with the server is putting towards MySQL.

Any Help you be appreciated
What apge is that on, what hacks have you installed.
Reply With Quote
  #4  
Old 12-03-2004, 03:45 PM
mcyates mcyates is offline
 
Join Date: Jan 2003
Location: Middlesbrough, Cleveland
Posts: 798
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well i had loads yesterday. What i've done today is installed a fresh copy and just copied the datatbase over. I now only have 2 hacks installed. Ucash/Ushop and vBookie. That is it. The stats are now:

Page generated in 0.33000803 seconds (47.75% PHP - 52.25% MySQL) with 13 queries
DEBUG Mode OFF | GZIP ON (level 1) | 1.06 : 0.95 : 0.79 | NO Uncached Templates

Is that good for the front page. /index.php???

What i don't understand how vbulletin.org has "Page generated in 0.15398 seconds with 15 queries" Thats on showthread. But my showthread is:

Page generated in 0.38000894 seconds (45.68% PHP - 54.32% MySQL) with 14 queries
DEBUG Mode OFF | GZIP ON (level 1) | 0.66 : 0.81 : 0.75 | NO Uncached Templates

Less quieries but longer to load the page. Also is that tru that its better to have a higher php% than a hight MySQL %?

Thanks
Reply With Quote
  #5  
Old 12-03-2004, 03:48 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mcyates
Well i had loads yesterday. What i've done today is installed a fresh copy and just copied the datatbase over. I now only have 2 hacks installed. Ucash/Ushop and vBookie. That is it. The stats are now:

Page generated in 0.33000803 seconds (47.75% PHP - 52.25% MySQL) with 13 queries
DEBUG Mode OFF | GZIP ON (level 1) | 1.06 : 0.95 : 0.79 | NO Uncached Templates

Is that good for the front page. /index.php???

What i don't understand how vbulletin.org has "Page generated in 0.15398 seconds with 15 queries" Thats on showthread. But my showthread is:

Page generated in 0.38000894 seconds (45.68% PHP - 54.32% MySQL) with 14 queries
DEBUG Mode OFF | GZIP ON (level 1) | 0.66 : 0.81 : 0.75 | NO Uncached Templates

Less quieries but longer to load the page. Also is that tru that its better to have a higher php% than a hight MySQL %?

Thanks
It should not be running 13 querys with no hacks, what is in your phpinclude template
Reply With Quote
  #6  
Old 12-03-2004, 03:51 PM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It can be tricky, because php can eat up just as much as mySQL if you let it. Ussally you associate more load with alot of mySQL queries because of the disk access going on. But php can cause just as much load checking and changing data for output.

Are you in a shared hosting enviroment? Other sites on the box can cause extra load server wide, remember you are all sharing the same resources.

What I would do is enter de-bug mode, and see if a mySQL query is taking awhile to run, if not you know you have a problem with some slow php code.

BTW you have defentaly increased the number of queries on index.php, I belive the stock installation runs 7 without vBcron, and 8 when vBcron is invoked.

This is vB3 we are talking about right?
Reply With Quote
  #7  
Old 12-03-2004, 04:17 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Oblivion Knight
No, PHP loading is MUCH better (and friendlier) than SQL..
Which one would be faster, then?
PHP Code:
$result $DB_site->query("SELECT pagetext FROM post");
$count 0;
while (
$post $DB_site->fetch_array($result))
{
    
$count += strlen($post['pagetext']);

or
PHP Code:
$result $DB_site->query_first("SELECT SUM(LENGTH(pagetext)) AS charcount FROM post");
$count $result['charcount']; 
The first makes MySQL do practically nothing but takes a huge amount of time (relative) in PHP to count up all the characters. The second makes MySQL work very hard, but PHP doesn't have to do much at all.

MySQL is not faster than PHP nor vice versa. It depends on how you code the solution.
Reply With Quote
  #8  
Old 12-03-2004, 11:51 PM
mcyates mcyates is offline
 
Join Date: Jan 2003
Location: Middlesbrough, Cleveland
Posts: 798
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Brad.loo
It can be tricky, because php can eat up just as much as mySQL if you let it. Ussally you associate more load with alot of mySQL queries because of the disk access going on. But php can cause just as much load checking and changing data for output.

Are you in a shared hosting enviroment? Other sites on the box can cause extra load server wide, remember you are all sharing the same resources.

What I would do is enter de-bug mode, and see if a mySQL query is taking awhile to run, if not you know you have a problem with some slow php code.

BTW you have defentaly increased the number of queries on index.php, I belive the stock installation runs 7 without vBcron, and 8 when vBcron is invoked.

This is vB3 we are talking about right?
yeah, well i've just relised. Some of the files in my vbulletin template on my computer were hacked and saved (which i forgot about and i though they were clean) so i installed vbulletin again with files which had been hacked. (only global.php was already hacked) when i put the brand new global.php (which i downloaded today) it dropped it to 8 on the index page and the page usually takes about 0.2 seconds to run.
Reply With Quote
  #9  
Old 12-04-2004, 11:01 AM
Oblivion Knight's Avatar
Oblivion Knight Oblivion Knight is offline
 
Join Date: May 2002
Location: Sheffield, UK
Posts: 1,757
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by filburt1
MySQL is not faster than PHP nor vice versa. It depends on how you code the solution.
I was speaking in General terms.

Something like that, of course - MySQL would be the sensible option.
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 06:02 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.04371 seconds
  • Memory Usage 2,250KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete