Skip to content
프로젝트

penberg/awesome-low-latency

GitHub에서 보기

소개

저지연 프로그래밍의 패턴과 리소스.

학습 및 교육

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
-1
in 7 days
+3
in 15 days
+4
in 1 month
+6

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Awesome Low Latency

Low latency programming is increasingly important across a variety of use cases. Still, many of the tips and tricks of low latency are only part of developer folklore. This document attempts to codify that knowledge for people to (re)discover the art of low-latency programming.

Patterns

How to Measure Latency Correctly

  • Latency is a distribution
  • Avoid coordinated omission
  • Visualize latency using eCDFs or histograms

Avoid Data Movement

  • Co-locate compute and data e.g. Processing-In-Memory or Processing-Near-Memory
  • Replicate data for faster access
  • Maximize cache hit rate
  • Control memory access patterns

Avoid Work

  • Tame algorithmic complexity
  • Avoid dynamic memory management
  • Avoid demand paging to prevent memory thrashing e.g. by using larger memory pages (hugepages on Linux, superpages on FreeBSD, ...)
  • Avoid as much work as possible (for example, avoid function call overhead by using inlining)
  • Avoid CPU intensive computation.

Avoid Waiting

  • Partition data to avoid sharing (and, therefore, synchronization)
  • Make shared data structures read-only (when possible)
  • Reduce head-of-line blocking
  • Avoid context switching
  • Use wait-free data synchronization
  • Use busy-polling instead of wakeups
  • Disable Nagle's algorithm
  • Use non-blocking I/O

Hide Latency

  • Parallelize requests to different services
  • Request hedging (send redundant requests to multiple replicase, use response from fastest one)
  • Use optimized SIMD instructions for suitable problems
  • Multiprocessing and multithreading

Tune for Low Latency

  • Use preemptible kernel
  • Interrupt and process affinity
  • Watch out for bad device drivers

Advanced Topics

  • Use kernel-bypass networking such as DPDK or XDP
  • Use hardware offload with accelerators and FPGA

Blogs

Publications

Books

Conferences

관련 프로젝트 살펴보기

불러오는 중…