我是Linux的新手,我想知道如何获得或计算Linux的往返时间中位数(RTT) n Linux?
Ping或Packet Internet Groper是一种网络管理实用程序,用于检查IP网络上源和目标计算机/设备之间的连接状态。它还帮助您评估发送和接收来自网络的响应所需的时间。
$ ping -c 5 127.0.0.1
发布于 2019-09-15 17:45:37
往返时间(RTT)是发送信号所需的时间长度加上接收该信号的确认所需的时间长度。因此,这一时间由两个信号点之间的传播时间组成。在Internet上,终端用户可以通过敲击IP(Internet Protocol)地址来确定RTT。结果视乎各种因素而定:
1. The data rate transfer of the source’s internet connection.
2. The nature of transmission medium.
3. The physical distance between source and destination.
4. The number of nodes between source and destination.
5. The amount of traffic on the LAN(Local Area Network) to which end user is connected.
6. The number of other requests being handled by intermediate nodes and the remote server.
7. The speed with which intermediate node and the remote server function.
8.The presence of Interference in the circuit.
# This program is used to calculate RTT
import time
import requests
# Function to calculate the RTT
def RTT(url):
# time period when the signal is sent
t1 = time.time()
r = requests.get(url)
# time period when acknowledgement of signal
# is received
t2 = time.time()
# total time taken during this process
tim = str(t2-t1)
print("Time in seconds :" + tim)
# Pilot program
# url address to hit
url = "http://www.google.com"
RTT(url)
Time in seconds :0.0579478740692
发布于 2020-11-28 16:02:09
发布于 2019-09-15 17:42:23
ping的iputils实现只对RTT进行了最小、平均、最大和移动标准差的总结。不是百分位数或中位数,而是有用的。
安装一个网络监控系统来测量TCP和ICMP,甚至可以更深入地了解您真正关心的用户响应时间。
尽管在许多ping实现中,mping似乎有一个百分位总结选项。也许其他人也是。
https://serverfault.com/questions/984306
复制相似问题