Skip to main content
InterviewHubPRO
Section Overview
Q39

Question 39 of 50

Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

78%
Linux OS Internals (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

Linux Epoll vs Select/Poll: How Event-Driven I/O enables the C10K and C10M problem solutions (Nginx, Node.js).

senior Levellinux-osAdvanced Internals

In Simple Words: Handling 10,000+ concurrent network connections:

  • select() / poll() (O(N) Complexity): The application passes an array of 10,000 file descriptors to the kernel on every loop. The kernel must iterate through all 10,000 items to check which one is ready, wasting CPU cycles.
  • epoll() (O(1) Complexity): The application registers sockets once in kernel memory (epoll_create, epoll_ctl). Sockets register hardware interrupt callbacks. When a packet arrives, the kernel places only the active socket onto a ready list. epoll_wait returns immediately with active descriptors only, enabling scalable event-driven architectures.