|
1 | 1 | # Vanilla HTTP Server - Data Flow |
2 | 2 |
|
3 | | -This document describes the complete data flow through the high-performance HTTP server, from connection establishment to response delivery. |
| 3 | +This document describes the complete data flow through the high-performance HTTP server, from |
| 4 | +connection establishment to response delivery. |
4 | 5 |
|
5 | 6 | ## System Architecture Overview |
6 | 7 |
|
@@ -347,11 +348,15 @@ Results: |
347 | 348 | **Future Optimizations:** |
348 | 349 |
|
349 | 350 | - **io_uring**: Zero-copy I/O with submission/completion queues, eliminating syscall overhead |
350 | | -- **Batched sends**: Use `writev()` or `sendmsg()` with scatter-gather to send response in one syscall |
351 | | -- **Response caching**: Pre-serialize common responses at startup, bypass routing/handler for cache hits |
| 351 | +- **Batched sends**: Use `writev()` or `sendmsg()` with scatter-gather to send response in one |
| 352 | + syscall |
| 353 | +- **Response caching**: Pre-serialize common responses at startup, bypass routing/handler for |
| 354 | + cache hits |
352 | 355 | - **CPU affinity**: Pin worker threads to specific cores to improve cache locality |
353 | 356 | - **DPDK bypass**: Bypass kernel network stack entirely for maximum throughput (userspace TCP/IP) |
354 | | -- **HTTP/2 multiplexing**: Share single connection for multiple requests, reduce connection overhead |
| 357 | +- **HTTP/2 multiplexing**: Share single connection for multiple requests, reduce connection |
| 358 | + overhead |
355 | 359 | - **JIT compilation**: V's `-prod` with PGO (profile-guided optimization) for hot paths |
356 | 360 | - **Memory pool**: Pre-allocate buffers in arena to eliminate allocation overhead |
357 | | -- **Lock-free queues**: If cross-worker communication needed, use MPSC queues instead of shared epoll |
| 361 | +- **Lock-free queues**: If cross-worker communication needed, use MPSC queues instead of shared |
| 362 | + epoll |
0 commit comments