Check out my first novel, midnight's simulacra!

Epoll: Difference between revisions

From dankwiki
No edit summary
No edit summary
Line 1: Line 1:
I don't like epoll so much as [[FreeBSD|FreeBSD's]] [[kqueue]], although many of its deficiencies have been overcome with the [http://kerneltrap.org/2.6.25 2.6.25 kernel release] and its addition of <code>timerfd_*</code> and <code>signalfd_*</code> functionality ([http://lwn.net LWN] had a good article regarding <code>timerfd</code> [http://lwn.net/Articles/245533/ here]). Note that these latter functions require [[glibc]] version 2.8 or later, or use of the <code>syscall()</code> multiplexer.
I don't like epoll so much as [[FreeBSD|FreeBSD's]] [[kqueue]], although many of its deficiencies have been overcome with the [http://kerneltrap.org/2.6.25 2.6.25 kernel release] and its addition of <code>timerfd_*</code> and <code>signalfd_*</code> functionality ([http://lwn.net LWN] had a good article regarding <code>timerfd</code> [http://lwn.net/Articles/245533/ here]). Note that these latter functions require [[glibc]] version 2.8 or later, or use of the <code>syscall()</code> multiplexer. EPOLLRDHUP was not added until 2.6.17.


==System Limits==
==System Limits==
* <tt>/proc/sys/fs/epoll/max_user_watches</tt>, since Linux 2.6.28, "specifies a limit on the total number of file descriptors that a user can register across all epoll instances on the system. The limit is per real user ID. Each registered file descriptor costs roughly 90 bytes on a 32-bit kernel, and roughly 160 bytes on a 64-bit kernel. Currently, the default value for max_user_watches is 1/25 (4%) of the available low memory, divided by the registration cost in bytes."
* <tt>/proc/sys/fs/epoll/max_user_watches</tt>, since Linux 2.6.28, "specifies a limit on the total number of file descriptors that a user can register across all epoll instances on the system. The limit is per real user ID. Each registered file descriptor costs roughly 90 bytes on a 32-bit kernel, and roughly 160 bytes on a 64-bit kernel. Currently, the default value for max_user_watches is 1/25 (4%) of the available low memory, divided by the registration cost in bytes."

Revision as of 01:00, 7 January 2010

I don't like epoll so much as FreeBSD's kqueue, although many of its deficiencies have been overcome with the 2.6.25 kernel release and its addition of timerfd_* and signalfd_* functionality (LWN had a good article regarding timerfd here). Note that these latter functions require glibc version 2.8 or later, or use of the syscall() multiplexer. EPOLLRDHUP was not added until 2.6.17.

System Limits

  • /proc/sys/fs/epoll/max_user_watches, since Linux 2.6.28, "specifies a limit on the total number of file descriptors that a user can register across all epoll instances on the system. The limit is per real user ID. Each registered file descriptor costs roughly 90 bytes on a 32-bit kernel, and roughly 160 bytes on a 64-bit kernel. Currently, the default value for max_user_watches is 1/25 (4%) of the available low memory, divided by the registration cost in bytes."