Apex › Systems & OS

epoll & the C10k problem

How one thread watches 10,000 sockets. select/poll re-scan every file descriptor on each call — O(n) even when one is active — the wall that capped servers at ~10k clients. epoll keeps a kernel ready-list and returns only fds with events: O(active). Drag the connection count to see the gap, then meet the edge-triggered gotcha that strands data if you don't drain fully.

More in Systems & OS