views:

84

answers:

2

What is the best way to test the speed of a LAMP based site, without factoring in the user's connection?

In other words, I have a CMS and I want to see how long it takes for PHP and MySQL to do all their work.

Additionally I do not have shell access to the server, it is in a shared hosting environment.

+2  A: 

The best way in this case is to let the server count itself. Wrap your CMS code to store the time the operation started, then substract it from the current time at the end of the script and print it.

You can use this code to read the time value:

function curtime()
{
        $tm = explode(' ', microtime());
        return $tm[1] + $tm[0];
}
ypnos
A: 

This can actually be quite a complicated thing to test, if you want an answer that matters to the user rather than the engineer. Keynote Systems does this sort of thing professionally. (Disclaimer: I almost took a job with them a long time ago, but haven’t talked to them in years.)

Flash Sheridan