Skip to content

nick-black Fast UNIX Servers

NOTE:

一、在 folly/folly/io/async/README.md 中,提及了本文:

Facebook has a lot of experience running services. For background reading, see The C10k problem and Fast UNIX servers

二、这篇文章非常好,非常详尽

Dan Kegel's classic site "The C10K Problem" (still updated from time to time) put a Promethean order to the arcana(奥秘) of years, with Jeff Darcy's "High-Performance Server Architecture" adding to our understanding. I'm collecting here some followup material to these excellent works (and of course the books of W. Richard Stevens, whose torch we merely carry). Some of these techniques have found, or will find, their way into libtorque, my multithreaded event unification library (and master's thesis).

NOTE:

翻译如下:

"Dan Kegel的经典网站“The C10K Problem”(仍然不时更新)用普罗米修斯式的顺序解释了多年来的奥秘,Jeff Darcy的“高性能服务器架构”增加了我们的理解。 我在这里收集了一些关于这些优秀作品的后续材料(当然还有w·理查德·史蒂文斯的书,我们只是拿着他的火炬)。 这些技术中的一些已经或将要在我的多线程事件统一库libtorque中找到它们的方法(以及我的硕士论文)。"

Central Design Principles

Varghese's Network Algorithmics: An Interdisciplinary Approach to Designing Fast Networked Devices is in a league of its own in this regard.

NOTE:

翻译如下:

"Varghese的《网络算法:设计快速网络设备的跨学科方法》在这方面有自己的见解。"

1、Principle 1: Exploit all cycles/bandwidth. Avoid blocking I/O and unnecessary evictions of cache, but prefetch into cache where appropriate (this applies to page caches just as much as processor caches or any other layer of the memory hierarchy). Be prepared to exploit multiple processing elements. Properly align data and avoid cache-aliasing effects. Use jumbo frames in appropriate scenarios and proactively warn on network degradation (e.g., half-duplex Ethernet due to failed link negotiation).

2、Principle 2: Don't duplicate work. Avoid unnecessary copies, context switches, system calls and signals. Use double-buffering or ringbuffers, and calls like Linux's splice(2).

NOTE:

"Avoid unnecessary copies" 对应的是 zero copy,比如 " Linux'shttps://nick-black.com/dankwiki/index.php?title=Linux_APIs splice(2)."

3、Principle 3: Measure, measure, and measure again, preferably automatically. Hardware, software and networks will all surprise you. Become friends with your hardware's performance counters and tools like eBPF, dtrace, ktrace, etc. Build explicit support for performance analysis into the application, especially domain-specific statistics.

Queueing Theory

NOTE:

暂未了解

Event Cores