[网络领域顶会追踪系列#22][NSDI'22]如何诊断丰富的终端主机栈中的纳秒级网络延迟

本系列为个人论文阅读笔记,大多数应该是对顶会摘要的个人菜鸟翻译,旨在让感兴趣的朋友能快速浏览、获取信息。如有错误或心得,欢迎在评论区交流指正!

How to diagnose nanosecond network latencies in rich end-host stacks

背景

低延迟网络栈已经将主机内的网络延迟降低至微秒制(microsecond-regime)。

挑战

然而,端主机分析器(profiler)有着高开销,导致它们只能用于确认一个假设,而无法在第一现场诊断问题。事实上,作者调研了20个低延迟的网络项目,其中的每一个都用的自己的分析工具,而不是使用现有的分析器。

工作

本文展示了如何去构建一个低开销、全栈覆盖的时延诊断工具,可以用来辨识而不只是确认端主机中时延的来源。

独特的测量方法以纳秒级的准确度,通过调和(reconciling)CPU和网卡硬件在多个时间域(网络和CPU)的分析器trace,重建了网络消息在端主机内的生命周期。

作者揭示了内核栈和用户栈上的意想不到的时延来源。

实验

作者通过使用他们的实现---NSight,展现了上述能力,来系统地辨别和移除memcached中的性能开销,以40的因子(从2.2ms到41us) 减少了第99.9%的时延。

原文摘要

Low-latency network stacks have brought down network latencies within end-hosts to the microsecond-regime. However, end-host profilers have such high overheads that they are useful only to confirm a hypothesis, not to diagnose a problem in the first place. Indeed, every one of twenty low-latency network projects we surveyed rolled their own analysis tools instead of using an existing profiler.

This paper shows how to build a latency diagnosis tool with full-stack coverage and low overhead that can identify, not just confirm, sources of latency in end hosts. The unique measurement methodology reconstructs network-message lifetimes within end hosts with nanosecond precision, by reconciling CPU and NIC hardware profiling traces across multiple time domains (network and CPU). It uncovers unexpected latency sources in both kernel and user-space stacks.

We demonstrate these capabilities by using our implementation, NSight, to systematically identify and remove performance overheads in memcached, reducing 99.9th percentile latency by a factor of 40 from 2:2 ms to 41 μs.