phpknight Posted July 20, 2007 Share Posted July 20, 2007 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"); } ?> Link to comment https://forums.phpfreaks.com/topic/60915-script-timing-test-participation-appreciated/ Share on other sites More sharing options...
phpknight Posted July 21, 2007 Author Share Posted July 21, 2007 *bump* No participation so far. If I can get enough data in for this to figure out if the problem a) also happens to others or b) is unique to my server, I'll donate $100 to phpfreaks.com. Hopefully that will spark some interest. Link to comment https://forums.phpfreaks.com/topic/60915-script-timing-test-participation-appreciated/#findComment-303889 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.