Chapter 17: Rejected Ideas — Futex, Rest Hubber, and Why They Failed
Futex-Based Thread Wakeup (Rejected)
Idea: Replace epoll-based wakeup with futex for faster thread signaling.
Why rejected:
- Profiling showed epoll overhead was NOT significant
- futex_wait overhead was similar to epoll_wait (both = context switch)
- Would require moving all I/O to ext_adapter thread (non-trivial refactor)
- DB interactions aren't thread-safe for splitting across threads
- Actual test showed PERFORMANCE REGRESSION, not improvement
Rest Hubber in PEP (On Hold)
Idea: Move HTTP server to a separate I/O thread (ext_adapter), dispatch work to main EVL via work queue.
Why on hold:
- Only makes sense if futex wakeup is used (which was rejected)
- Adds thread boundary crossing (latency)
- Complex refactor for uncertain benefit
- No measured bottleneck in current HTTP handling
Time-Based Batching in db-proxy (Not Done)
Idea: Add a timer to db-proxy that accumulates commands before flushing.
Why not done: db-proxy is being replaced by db-mux entirely. No point optimizing the old library.
PEP DB Batching Across Sessions (Not Possible)
Idea: Batch DB operations from different PFCP sessions together.
Why not possible: Different sessions hash to different Valkey slots. MSET requires all keys on same slot. Can't batch across sessions in a cluster.
Not every optimization idea works. The team investigated thoroughly, measured, and rejected ideas based on evidence. This is good engineering — measure first, then decide.