devpoll_events

The `devpoll_events` directive configures NGINX to use the DEVPOLL event notification mechanism for managing connections.

Syntaxdevpoll_events;
Defaultnone
Contextevents
Arguments1

Description

The devpoll_events directive, when specified in the events context, enables the DEVPOLL mechanism for connection handling in NGINX's event-driven architecture. DEVPOLL, available on Solaris and variations of other Unix-like systems, offers a scalable way to handle a large number of simultaneous connections. By using DEVPOLL, NGINX can efficiently monitor and respond to events on file descriptors without needing to perform O(n) linear scans, which can be a bottleneck with other event models like select() or poll().

This directive does not take any arguments and is typically used to optimize performance for server applications under high load conditions. It allows the worker processes to sleep and reactively handle incoming connections or other events, promoting better CPU usage and performance metrics due to lower context switching and improved overall system responsiveness. It mainly benefits environments where a considerable number of simultaneous connections is anticipated, such as web servers handling thousands of users.

Config Example

events {
    devpoll_events;
}

Ensure your operating system supports DEVPOLL, as this directive is only applicable on systems that implement this mechanism.

Incorrectly configuring the NGINX worker processes can lead to suboptimal performance even with DEVPOLL enabled.

← Back to all directives