MyBB Community Forums

Full Version: 85% PHP? o.o
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Generated in 0.1076930 seconds (85.66% PHP / 14.34% MySQL)
SQL Queries: 40 / Global Parsing Time: 0.0635889 / Memory Usage: 7.5 MB
PHP version: 5.2.15 / Server Load: 11.97 / GZip Compression: Enabled

Shouldn't there be more SQL than PHP? I've researched on this and all the people have like 85% SQL, not PHP.

What's wrong?
I don't know what you mean by "all the people have like 85% SQL, not PHP". Certainly not on a normal MyBB forum anyway, but other plugins may add extra SQL queries.

On my forum, it runs at close to 87/90% PHP quite consistently.
Ah okay, thanks. I just found it weird that until now it was constantly 80% SQL. In the past few days it has been at 80-85% PHP.
MySQL would have been working a bit harder then. This figure is how much of the page generation time was taken up by PHP working, and how much was taken up by MySQL working. Generally higher PHP is better, as if MySQL is high then you might have bad queries etc, but high PHP could mean you have badly written code and it's stuck in a loop for ages or something.
(2011-04-19, 06:37 PM)MattRogowski Wrote: [ -> ]MySQL would have been working a bit harder then. This figure is how much of the page generation time was taken up by PHP working, and how much was taken up by MySQL working. Generally higher PHP is better, as if MySQL is high then you might have bad queries etc, but high PHP could mean you have badly written code and it's stuck in a loop for ages or something.

Is there a way to test for said "looping"?
(2011-04-19, 07:00 PM)lucasbytegenius Wrote: [ -> ]Is there a way to test for said "looping"?

You don't need to, those are pretty normal numbers. Now if you had the same data, but your execution time was higher (for example 30 seconds is VERY bad usually) then you would worry.
(2011-04-19, 07:00 PM)lucasbytegenius Wrote: [ -> ]
(2011-04-19, 06:37 PM)MattRogowski Wrote: [ -> ]MySQL would have been working a bit harder then. This figure is how much of the page generation time was taken up by PHP working, and how much was taken up by MySQL working. Generally higher PHP is better, as if MySQL is high then you might have bad queries etc, but high PHP could mean you have badly written code and it's stuck in a loop for ages or something.

Is there a way to test for said "looping"?

Looping is basically a LONG if() statements written poorly, like;
if ($something)
{
   if ($something)
   {
      if ($something)
      {
            // some code runs here...
      }
   }
}

In this case the code executes too slow.
Umm, no Yald, an example of a bad loop is this:
for(;;)
{
   echo "Infinite Loop! - This will execute until PHP's max_execution_time limit is reached!";
}

If statements are not loops.
(2011-04-19, 07:14 PM)Yaldaram Wrote: [ -> ]
(2011-04-19, 07:00 PM)lucasbytegenius Wrote: [ -> ]Is there a way to test for said "looping"?

Looping is basically a LONG if() statements written poorly, like;
if ($something)
{
   if ($something)
   {
      if ($something)
      {
            // some code runs here...
      }
   }
}

In this case the code executes too slow.

... no. An if statement is an if statement. A loop is a loop. An if statement does not loop, it's a conditional. The code you posted will not execute slowly at all, it's perfectly good PHP, obviously you're going to have to use nested if statements in code.
(2011-04-19, 07:12 PM)Dylan M. Wrote: [ -> ]
(2011-04-19, 07:00 PM)lucasbytegenius Wrote: [ -> ]Is there a way to test for said "looping"?

You don't need to, those are pretty normal numbers. Now if you had the same data, but your execution time was higher (for example 30 seconds is VERY bad usually) then you would worry.

Well I'm just saying hypothetically if I had this problem, how would I test it to see which file(s) are causing it?
Pages: 1 2