Generated by GPT-5-mini| epoll | |
|---|---|
| Name | epoll |
| Author | Mikio Toyoda; Madalin V. Neacsu? |
| Developer | Linux kernel developers |
| Released | 2002 |
| Operating system | Linux |
| License | GNU General Public License |
epoll
epoll is a scalable I/O event notification facility provided by the Linux kernel. It was introduced to address limitations in earlier interfaces and is commonly used by projects in environments such as Apache HTTP Server, Nginx, Redis, PostgreSQL, MySQL and OpenSSH. Major software ecosystems including GNOME, KDE, Docker, Kubernetes, and systemd have leveraged epoll-driven architectures for efficient file descriptor management.
epoll provides an interface for monitoring multiple file descriptors to detect readiness for I/O operations. It replaced or complemented earlier mechanisms used in UNIX System V, FreeBSD, Solaris, NetBSD and applications written for POSIX-style systems like GCC-compiled server daemons. Implementations and adopters include infrastructure projects such as Google-backed initiatives, Facebook services, Twitter streaming components, and networking stacks used by Amazon Web Services and Microsoft Azure-hosted Linux instances.
The API exposes operations to create an epoll instance, add, modify, and remove file descriptors, and wait for events. Typical system calls interact with the Linux kernel through syscall interfaces similar in spirit to earlier select(2) and poll(2) semantics but optimized for large descriptor sets. Libraries and runtimes that wrap epoll include libevent, libuv, Boost.Asio, Node.js, Python asyncio backends, and Rust async runtimes such as Tokio. Language bindings and frameworks used in Ruby on Rails, Django, Flask, Java NIO layers, and .NET Core interoperable layers often integrate epoll via platform-adaptive I/O polling abstractions.
Internally, epoll uses kernel data structures and edge-triggered or level-triggered notification semantics implemented in the Linux kernel networking and VFS subsystems. The kernel component interacts with device drivers for Ethernet interfaces, InfiniBand hardware, and virtual devices exposed by QEMU and KVM. Core contributors and maintainers in the Linux Foundation and various kernel subsystems have iterated on epoll behavior across kernel versions aligned with releases from Linus Torvalds-led merges. Epoll's implementation relies on efficient ready lists, callback pathways shared with io_uring and asynchronous I/O subsystems, and interaction points with the scheduler, memory management and interrupt handling code paths.
Epoll offers lower overhead for high-concurrency network servers compared to legacy interfaces in scenarios such as large-scale HTTP proxying, real-time messaging, and high-frequency trading systems used in firms like Jane Street and exchange platforms. Benchmarks from projects like nginx and Redis demonstrate superior scaling as concurrent connections grow into the tens or hundreds of thousands, benefiting cloud platforms run by Google Cloud Platform, Amazon EC2, and Microsoft Azure. It is particularly effective for event-driven architectures in microservices deployments managed by Kubernetes and container ecosystems orchestrated by Docker, and is used in observability stacks like Prometheus and logging pipelines such as Elastic Stack.
Epoll is Linux-specific; cross-platform applications targeting Windows, macOS, or BSD-derived systems often use alternatives such as kqueue on FreeBSD and macOS, IOCP on Microsoft Windows, or higher-level libraries like libevent and libuv that abstract platform differences. Emerging mechanisms like io_uring offer different trade-offs, exposing asynchronous submission queues and completion queues for reduced syscall overhead. Some workloads constrained by kernel version compatibility, real-time requirements in QNX-based systems, or specialized networking stacks in Solaris environments may prefer other models or kernel bypass techniques used by DPDK.
Epoll appeared in the early 2000s as a response to scaling problems observed in production deployments at organizations running large web and database servers. Kernel maintainers and contributors from organizations such as IBM, Intel, Red Hat, Canonical, and SUSE have played roles in stabilizing and evolving the interface. Over time, epoll became a de facto standard for high-performance Linux network applications and was adopted by major open-source projects including Nginx, Apache HTTP Server, Lighttpd, HAProxy, Redis, and language ecosystems like Node.js and Python for their production I/O backends. Its adoption parallels growth in cloud computing platforms and modern orchestration systems such as OpenStack and Kubernetes.