schweikert / fping

High performance ping tool

Home Page:https://fping.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Time of execution when using retry -r increases in a nonlinear growth

DimplyKhan13 opened this issue · comments

I've been installing fping for monitoring equipments in a network, and found a strange behavior that I don't understand and see it as a problem. When using -r, the execution time increases in a non-expected, not linear, way. Here is some data, using an IP address that doesn't exist in the network:

Without -r, it takes a second, as expected:

time fping 10.12.42.27 -b 32 -c 1 -t 1000 -i 50
10.12.42.27 : [0], timed out (NaN avg, 100% loss)

10.12.42.27 : xmt/rcv/%loss = 1/0/100%

real    0m1.004s
user    0m0.000s
sys     0m0.002s

With -r 1, a single retry, the time is as expected, (2*Timeout + 0.5s):

time fping 10.12.42.27 -b 32 -r 1 -t 1000 -i 50
10.12.42.27 is unreachable

real    0m2.505s
user    0m0.001s
sys     0m0.000s`

When doing 2 retries, the time grows outside what I expected:

time fping 10.12.42.27 -b 32 -r 2 -t 1000 -i 50
10.12.42.27 is unreachable

real    0m4.758s
user    0m0.001s
sys     0m0.000s

Here is a table of values following the same pattern:

-r 3        0m8.136s
-r 4        0m13.201s
-r 5        0m20.806s
-r 5        0m32.202s

Is there a reason for the increment after each try not be (Timeout + Time Between Tries)? Shouldn't it be a linear growth on time?

fping increases the wait time for each reply by a factor that defaults to 1.5 (it can be controlled via -B). With a timeout T and a backoff factor B, the n-th wait between probes is T*B^(n-1). (The first wait is T, the second is T*B, the third is T*B*B, and so on.)

If you really want to, you can disable the effect using -B 1:

$ time fping -r3 -t1000 -B1 10.11.12.13
10.11.12.13 is unreachable

real	0m4,016s
user	0m0,000s
sys	0m0,001s

Thank you very much!