schweikert / fping

High performance ping tool

Home Page:https://fping.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fping: reporting negative values

ktsaou opened this issue · comments

Hi,

I see in netdata that fping reports negative values:

screenshot from 2017-06-19 13-10-25

By default, netdata runs fping with these settings:

fping -N -l -Q 1 -p 200 -R -b 56 -i 1 -r 0 -t 5000 host1 host2 host3 ...

But, I guess these trigger the problem.
fping is v4.0.

Example output from fping:

# fping -N -l -Q 1 -p 200 -R -b 56 -i 1 -r 0 -t 5000 london
fping: warning: timeout (-t) value larger than period (-p) produces unexpected results
CHART fping.london_packets '' 'FPing Packets for host london' packets 'london' fping.packets line 110020 1
DIMENSION xmt sent absolute 1 1
DIMENSION rcv received absolute 1 1
BEGIN fping.london_packets
SET xmt = 5
SET rcv = 5
END
CHART fping.london_quality '' 'FPing Quality for host london' percentage 'london' fping.quality area 110010 1
DIMENSION returned '' absolute 1 1
BEGIN fping.london_quality
SET returned = 100
END
CHART fping.london_latency '' 'FPing Latency for host london' ms 'london' fping.latency area 110000 1
DIMENSION min minimum absolute 10 1000
DIMENSION max maximum absolute 10 1000
DIMENSION avg average absolute 10 1000
BEGIN fping.london_latency
SET min = 795
SET avg = 809
SET max = 844
END
BEGIN fping.london_packets
SET xmt = 4
SET rcv = 4
END
BEGIN fping.london_quality
SET returned = 100
END
BEGIN fping.london_latency
SET min = -40522                  # <<<<<< NEGATIVE
SET avg = -9520                   # <<<<<< NEGATIVE
SET max = 844
END
BEGIN fping.london_packets
SET xmt = 5
SET rcv = 5
END
BEGIN fping.london_quality
SET returned = 100
END
BEGIN fping.london_latency
SET min = 792
SET avg = 796
SET max = 801
END
^Clondon : xmt/rcv/%loss = 57/57/0%, min/avg/max = -4.1e+02/0.88/10.5

Any ideas what is wrong?

When run manually, I see that fping prints a warning:

# fping -N -l -Q 1 -p 200 -R -b 56 -i 1 -r 0 -t 5000 london
fping: warning: timeout (-t) value larger than period (-p) produces unexpected results

From the help I see that:

   -p, --period=MSEC  interval between ping packets to one target (in ms)
                      (in loop and count modes, default: 1000 ms)

   -t, --timeout=MSEC individual target initial timeout (default: 500 ms,
                      except with -l/-c/-C, where it's the -p period up to 2000 ms)

Which is a bit confusing. I need to send 5 packets per second per host, one every 200ms, and each packet to timeout after 5 seconds (so it will be reported missing only if 5 seconds have passed since it was sent).

I see that even if I set -t 200 (equal to -p), the problem still exists. It also exists for non-netdata output:

# fping -l -Q 1 -p 200 -R -b 56 -i 1 -r 0 -t 5000 london
fping: warning: timeout (-t) value larger than period (-p) produces unexpected results

london : xmt/rcv/%loss = 5/5/0%, min/avg/max = 7.89/8.07/8.55
[13:30:48]
london : xmt/rcv/%loss = 3/3/0%, min/avg/max = 7.85/7.96/8.12
[13:30:49]
london : xmt/rcv/%loss = 5/5/0%, min/avg/max = -4.1e+02/-76/8.05
[13:30:50]
london : xmt/rcv/%loss = 5/5/0%, min/avg/max = 7.83/7.94/8.20

Issue found: azure clock syncronization with hyper-v has this issue with ubuntu 16.04.
Disabling hyper-v time sync, solved the negative values reported by fping.

I will be glad to ship netdata with better fping defaults.
Let me know if you have any comments about :

fping -l -Q 1 -p 200 -R -b 56 -i 1 -r 0 -t 5000 host1 host2 host3 ...