Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.4.5

Bug #18013 Time to ping
Submitted: 2010-10-29 20:58 UTC
From: toobulkeh Assigned:
Status: Open Package: Net_Ping (version 2.4.5)
PHP Version: 5.1.6 OS: 2.6.18-194.11.3.el5
Roadmaps: (Not assigned)    
Subscription  


 [2010-10-29 20:58 UTC] toobulkeh (Dan Moore)
Description: ------------ a count of > 1 returns horrible Ping times. For example a count of 1 returns a page generated time of 0.023s for 4 IP addresses while a count of 2 returns ~ 4 seconds for the same IP addresses (A 200x increase in time, not 2x increase). Timeout doesn't appear to have an effect on it either. Test script: --------------- $time = microtime(); $time = explode(" ", $time); $time = $time[1] + $time[0]; $start = $time; $ping = Net_Ping::factory(); if (PEAR::isError($ping)) { echo $ping->getMessage(); } else { $ping->setArgs(array('count' => 2, 'timeout' => 1)); $pingResult = $ping->ping("localhost"); } $time = microtime(); $time = explode(" ", $time); $time = $time[1] + $time[0]; $finish = $time; $totaltime = ($finish - $start); echo "Page generated in ".$totaltime."s<br>"; Expected result: ---------------- You should get a time generated of ~ 0.01s for the above script Actual result: -------------- You actually get a time generated of ~ 1s for the script.

Comments

 [2012-04-19 19:32 UTC] pacmanbg (Ivan Minev)
Actually this is not a bug. The effect comes from default behavior of the ping command, which by default waits 1 second between pings. but there can be added additional argument in Net_Ping "interval" which will be used to set "-i" parameter to the linux ping command.