[MAJOR] introduced speculative I/O with epoll()
The principle behind speculative I/O is to speculatively try to
perform I/O before registering the events in the system. This
considerably reduces the number of calls to epoll_ctl() and
sometimes even epoll_wait(), and manages to increase overall
performance by about 10%.
The new poller has been called "sepoll". It is used by default
on Linux when it works. A corresponding option "nosepoll" and
the command line argument "-ds" allow to disable it.
diff --git a/src/haproxy.c b/src/haproxy.c
index f1e5cc3..f8946f9 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -175,6 +175,9 @@
#if defined(ENABLE_EPOLL)
" -de disables epoll() usage even when available\n"
#endif
+#if defined(ENABLE_SEPOLL)
+ " -ds disables speculative epoll() usage even when available\n"
+#endif
#if defined(ENABLE_KQUEUE)
" -dk disables kqueue() usage even when available\n"
#endif
@@ -374,6 +377,9 @@
#if defined(ENABLE_EPOLL)
cfg_polling_mechanism |= POLL_USE_EPOLL;
#endif
+#if defined(ENABLE_SEPOLL)
+ cfg_polling_mechanism |= POLL_USE_SEPOLL;
+#endif
#if defined(ENABLE_KQUEUE)
cfg_polling_mechanism |= POLL_USE_KQUEUE;
#endif
@@ -399,6 +405,10 @@
else if (*flag == 'd' && flag[1] == 'e')
cfg_polling_mechanism &= ~POLL_USE_EPOLL;
#endif
+#if defined(ENABLE_SEPOLL)
+ else if (*flag == 'd' && flag[1] == 's')
+ cfg_polling_mechanism &= ~POLL_USE_SEPOLL;
+#endif
#if defined(ENABLE_POLL)
else if (*flag == 'd' && flag[1] == 'p')
cfg_polling_mechanism &= ~POLL_USE_POLL;
@@ -534,6 +544,9 @@
if (!(cfg_polling_mechanism & POLL_USE_EPOLL))
disable_poller("epoll");
+ if (!(cfg_polling_mechanism & POLL_USE_SEPOLL))
+ disable_poller("sepoll");
+
if (!(cfg_polling_mechanism & POLL_USE_POLL))
disable_poller("poll");