[转帖]Latency numbers every programmer should know 计算机中的延迟对比

latency,numbers,every,programmer,should,know,计算机,延迟,对比 · 浏览次数 : 0

小编点评

**延迟比较** | 时间单位 | 延迟(纳秒) | |---|---| | 1 nano秒 | 10^-9 | | 1 us | 10^-6 | | 1 ms | 10^-3 | | 1 hr | 3600 | | 1 day | 86,400 | | 1 周 | 52,800 | | 1 年 | 31,536,000 | **注意:** *这些延迟只是理论上的,实际延迟可能因硬件、软件版本和网络状况而有所不同。 *一些数字可能具有不同的单位,具体取决于它们如何被测量。

正文

https://www.cnblogs.com/xuyaowen/p/latencys.html

 

每个编程者都应该知道的延迟:(~2012年的性能)

复制代码
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference                           0.5 ns
Branch mispredict                            5   ns
L2 cache reference                           7   ns                      14x L1 cache
Mutex lock/unlock                           25   ns
Main memory reference                      100   ns                      20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy             3,000   ns        3 us
Send 1K bytes over 1 Gbps network       10,000   ns       10 us
Read 4K randomly from SSD*             150,000   ns      150 us          ~1GB/sec SSD
Read 1 MB sequentially from memory     250,000   ns      250 us
Round trip within same datacenter      500,000   ns      500 us
Read 1 MB sequentially from SSD*     1,000,000   ns    1,000 us    1 ms  ~1GB/sec SSD, 4X memory
Disk seek                           10,000,000   ns   10,000 us   10 ms  20x datacenter roundtrip
Read 1 MB sequentially from disk    20,000,000   ns   20,000 us   20 ms  80x memory, 20X SSD
Send packet CA->Netherlands->CA    150,000,000   ns  150,000 us  150 ms

Notes
-----
1 ns = 10^-9 seconds
1 us = 10^-6 seconds = 1,000 ns
1 ms = 10^-3 seconds = 1,000 us = 1,000,000 ns

Credit
------
By Jeff Dean:               http://research.google.com/people/jeff/
Originally by Peter Norvig: http://norvig.com/21-days.html#answers

Contributions
-------------
'Humanized' comparison:  https://gist.github.com/hellerbarde/2843375
Visual comparison chart: http://i.imgur.com/k0t1e.png
复制代码

更为形象化:

 

更为可读的对比:

复制代码
Lets multiply all these durations by a billion:

Magnitudes:

### Minute:
    L1 cache reference                  0.5 s         One heart beat (0.5 s)
    Branch mispredict                   5 s           Yawn
    L2 cache reference                  7 s           Long yawn
    Mutex lock/unlock                   25 s          Making a coffee

### Hour:
    Main memory reference               100 s         Brushing your teeth
    Compress 1K bytes with Zippy        50 min        One episode of a TV show (including ad breaks)

### Day:
    Send 2K bytes over 1 Gbps network   5.5 hr        From lunch to end of work day

### Week
    SSD random read                     1.7 days      A normal weekend
    Read 1 MB sequentially from memory  2.9 days      A long weekend
    Round trip within same datacenter   5.8 days      A medium vacation
    Read 1 MB sequentially from SSD    11.6 days      Waiting for almost 2 weeks for a delivery

### Year
    Disk seek                           16.5 weeks    A semester in university
    Read 1 MB sequentially from disk    7.8 months    Almost producing a new human being
    The above 2 together                1 year

### Decade
    Send packet CA->Netherlands->CA     4.8 years     Average time it takes to complete a bachelor's degree
复制代码

参考来源:https://gist.github.com/jboner/2841832

保持更新;

与[转帖]Latency numbers every programmer should know 计算机中的延迟对比相似的内容:

[转帖]Latency numbers every programmer should know 计算机中的延迟对比

https://www.cnblogs.com/xuyaowen/p/latencys.html 每个编程者都应该知道的延迟:(~2012年的性能) Latency Comparison Numbers (~2012) L1 cache reference 0.5 ns Branch mispred

[转帖]Diagnosing latency issues

Finding the causes of slow responses This document will help you understand what the problem could be if you are experiencing latency problems with Re

[转帖]Tail Latency学习

https://www.cnblogs.com/Rohn/p/15123758.html Latency,中文译作延迟,Tail Latency即尾延迟。 实际生产中的Latency是一种(概率)分布,实际上被描述为百分位数。 延迟可以在 75% 百分位处翻倍,在 99% 之后高出 100 倍。 什

[转帖]INTEL MLC(Memory Latency Checker)介绍

https://zhuanlan.zhihu.com/p/359823092 在定位机器性能问题的时候,有时会觉得机器莫名其妙地跑的慢,怎么也看不出来问题。CPU频率也正常,程序热点也没问题,可就是慢。这时候可以检查一下内存的访问速度,看看是不是机器的内存存在什么问题。Intel Memory La

[转帖]高并发系统中的尾延迟Tail Latency

开发和运维高并发系统的工程师可能都有过类似经验,明明系统已经调优完毕,该异步的异步,该减少互斥的地方引入无锁,该减少IO的地方更换引擎或者硬件,该调节内核的调节相应参数,然而,如果在系统中引入实时监控,总会有少量响应的延迟高于均值,我们把这些响应称为尾延迟(Tail Latency)。对于大规模分布

[转帖]heapmap

https://github.com/brendangregg/HeatMap HeatMap Some software to generate heat maps: trace2heatmap.pl converts a trace of per-event latency to an inte

[转帖]Java游戏服务器调优实践

https://www.jianshu.com/p/344f8141b63e Java Profiling Practice landon资深网络游戏服务器架构师 系统性能定义 Throughput 吞吐量,也就是每秒钟可以处理的请求数,任务数 Latency 系统延迟,也就是系统在处理一个请求或一

[转帖]Java游戏服务器调优实践

https://www.jianshu.com/p/344f8141b63e landon资深网络游戏服务器架构师 系统性能定义 Throughput 吞吐量,也就是每秒钟可以处理的请求数,任务数 Latency 系统延迟,也就是系统在处理一个请求或一个任务时的延迟 二者关系 Throughput越

[转帖]

Linux ubuntu20.04 网络配置(图文教程) 因为我是刚装好的最小系统,所以很多东西都没有,在开始配置之前需要做下准备 环境准备 系统:ubuntu20.04网卡:双网卡 网卡一:供连接互联网使用网卡二:供连接内网使用(看情况,如果一张网卡足够,没必要做第二张网卡) 工具: net-to

[转帖]

https://cloud.tencent.com/developer/article/2168105?areaSource=104001.13&traceId=zcVNsKTUApF9rNJSkcCbB 前言 Redis作为高性能的内存数据库,在大数据量的情况下也会遇到性能瓶颈,日常开发中只有时刻