第95个百分位数(95th Percentile)是什么

95th-percentile

什么是第95个百分位数?我们先看看wiki上的解释:https://en.wikipedia.org/wiki/Burstable_billing#95th_percentile

The 95th percentile is a widely used mathematical calculation to evaluate the regular and sustained use of a network connection. The 95th percentile method more closely reflects the needed capacity of the link in question than tracking by other methods such as mean or maximum rate. The bytes that make up the packets themselves do not actually cost money, but the link and the infrastructure on either end of the link cost money to set up and support. This method of billing is commonly used in peering arrangements between corporate networks, it is not often used by ISPs because Internet service providers need committed information rates (CIRs) for planning purposes.

前两句

The 95th percentile is a widely used mathematical calculation to evaluate the regular and sustained use of a network connection.The 95th percentile method more closely reflects the needed capacity of the link in question than tracking by other methods such as mean or maximum rate.

怎么理解?

我自己的理解,就是一组样本数组中,低于某个样本值的样本子集,该子集占整体样本的N%(通常有 90th 95th 98th etc.),那改样本的值就称为N%对应的百分位数

怎么算?

摘自上一个简单的例子

收集的数据为60,45,43,21,56,89,76,32,22,10,12,14,23,35,45,43,23,23,43,23 (20 个点)。将该序列降序排列,其最大值为89。由于20个点的5%为1,所以我们舍弃1个最大值89。剩下的最大值76就是我们所说的95th百分点

应用?

在pm2 monit中,可以查看进程的运行状态,包括不仅限于:

Heap size
Heap Usage
Usead Heap Size
...
HTTP P95 Latency

HTTP P95 Latency 此时标识的应该是当前网络延时的最大值,P95会剔除网络中峰值的毛刺,留下的是相对比较准确的最大值 👇

The 95th percentile is a widely used mathematical calculation to evaluate the regular and sustained use of a network connection.