ping to do an estimate of lower bound for HTTP request times as part of a feasibility study.
In order to make the test faster I lowered the interval of the ping (to get enough pings to get a reasonable average) and noted that if the interval gets short the RTT against local host dropped. For example:
>sudo ping -i 0.01 -c500 -q localhost PING localhost (127.0.0.1) 56(84) bytes of data. --- localhost ping statistics --- 500 packets transmitted, 500 received, 0% packet loss, time 5986ms rtt min/avg/max/mdev = 0.006/0.007/0.055/0.004 ms >sudo ping -i 0.00 -c500 -q localhost PING localhost (127.0.0.1) 56(84) bytes of data. --- localhost ping statistics --- 500 packets transmitted, 500 received, 0% packet loss, time 8ms rtt min/avg/max/mdev = 0.003/0.004/0.016/0.000 ms, ipg/ewma 0.018/0.004 ms
-f option yielded similar results as
Why does the flood
ping give 4us RTT while the non-flood gives 8us? If I skip the
-q flag it gets even worse as the non-flood will get up to 34us. Why this difference for printing a line for each individual pings?
My guess is that the ICMP packets are put in a queue and there's a latency before the kernel processes the queue and if there's more ICMP packets it could be that it can process them all in the same go.
A follow up question might be if ping RTT's are relevant for local host, it might be that TCP/IP is not being used when doing a localhost HTTP request.
For the record: I'm running Linux (#1 SMP Debian 3.2.68-1+deb7u2).