Jetrelay: A Highly Efficient Pub/Sub Server Leveraging Linux Kernel Features
2025-05-16
Jetrelay, a pub/sub server compatible with Bluesky's jetstream, achieves impressive efficiency with only 500 lines of code. By cleverly utilizing Linux kernel features like `sendfile()`, `io_uring`, and `fallocate()`, Jetrelay broadcasts data and manages persistent storage with minimal user-space overhead. This allows it to saturate a 10Gbps network connection using just 8 CPU cores. The design avoids unnecessary data copies and uses asynchronous I/O to handle thousands of concurrent client connections effectively.
Development