vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Problem (82.09% PHP - 17.91% MySQL) (https://vborg.vbsupport.ru/showthread.php?t=72441)

mcyates 12-03-2004 06:57 AM

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

Oblivion Knight 12-03-2004 07:58 AM

No, PHP loading is MUCH better (and friendlier) than SQL.. :)

Zachery 12-03-2004 03:39 PM

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.

mcyates 12-03-2004 03:45 PM

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

Zachery 12-03-2004 03:48 PM

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

Brad 12-03-2004 03:51 PM

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? :)

filburt1 12-03-2004 04:17 PM

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.

mcyates 12-03-2004 11:51 PM

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.

Oblivion Knight 12-04-2004 11:01 AM

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.


All times are GMT. The time now is 05:27 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.01264 seconds
  • Memory Usage 1,742KB
  • 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_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete