Jump to content

Script timing test - participation appreciated


phpknight

Recommended Posts

Everybody, I have been having this crazy issue that nobody can figure out.  Scripts sometimes run at .01 seconds, and other times take 45 seconds.  I track every script on my server, IPs, etc., the server has changed RAM, but nothing works.  So, I have designed a test in which anybody can participate.  This will time all scripts so I will see if certain IPs cause this, if it is normal for PHP or not, etc.

 

If you are interested, please follow the two steps at the bottom.  Please feel free to change any variable names or delete any information you do not feel comfortable sharing.

 

This code times any execution of a script on the SERVER.  I am not looking for fast/slow but unexplained time variance in the SAME script.  Do not keep reloading the page.  Just let normal traffic/search engines go.  If this happens to everybody, then I will stop obsessing about this and consider it a PHP thing.

 

I understand this is a lot to ask, but this test might help solve issues for others in the future as well. 

 

It is not necessary to sign up, but you can send me an email at the address below if you want.  That way, I can let you know when the test ends and update you on results of your domain.

 

Feel free to send any questions to the email below.  All is for a noble purpose.

 

phpknight

-----

 

1.) Insert this code on the top of any page:

 
<?PHP
$time1=microtime(get_as_float);
?>

 

2.) Insert this code at the bottom:

 

<?PHP

$time2=microtime(get_as_float);

$difference=$time2-$time1;
$testFile=$_SERVER['SCRIPT_NAME'];
$theIP=$_SERVER['REMOTE_ADDR'];
$theServer=$_SERVER['SERVER_NAME'];

if ($difference>0.000000001)
{
$difference = number_format ($difference, 4);
   
mail("[email protected]", "$testFile Tot: $difference Server: $theServer IP: $theIP", "end");
}

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.