Description
Currently we use a pair of sockets to notify a memcached frontend thread when there's an event to handle (notify_IO_complete).
We should investigate using the more modern eventfd functionality which is more lightweight. A patch was briefly merged to switch to eventfd (via libevent's higher-level abstraction - see http://review.couchbase.org/#/c/116587/) however this resulted in a performance regression in very write-heavy workloads: numbers from daily performance runs (KV : Pillowfight, 20/80 R/W, 256B
binary items) shows that this actually reduces performance by ~2%
(see build 4631 vs 4632).
A brief look at the libevent code suggests this is due to event_active() needing to acquire the per-event base mutex, which wasn't the case with the previous implementation which just wrote to an FD.
We could either implement eventfd() support "manually" - i.e. create an eventfd file descriptor instead of socketpair when supported, and write the correct type of write; or use folly::EventBase which is a C++ OO wrapper around libevent and already supports eventfd via NotificationQueue.
Attachments
Issue Links
- relates to
-
MB-36956 Migrate to Facebook Folly executors for CPU & IO background tasks
- Closed