Spread 5.0.0 kqueue and epoll Patch
This patch is a complete rewrite of a previous patch for adding
epoll
and poll
support
to Spread 4.x. It makes Spread 5.0.0 replace daemon select
calls with FreeBSD kqueue
or
Linux epoll
. POSIX poll
support for the client library is standard as of Spread release
5.0.0rc2 and no longer requires a patch. The availalability
of kqueue
or epoll
is
detected automatically. Therefore, you do not have to manually
define any macros. Using kqueue
or epoll
can improve the performance of a
Spread daemon when it is serving thousands to millions of client
connections.
As of Spread version 5.0.0rc2, the following changes have been incorporated into the upstream release and no longer require a patch:
Beyond adding enhanced event processing, this patch fixes a FreeBSD compilation error, installation on systems using Perl 5.22 or higher, log file initialization and writing with
-l
option, interface binding in loopback-only configurations, some event processing related range checks, and a premature socket descriptorclose
bug.
Patch File | Comment |
---|---|
spread-5.0.0-kqueue-epoll.patch.gz | Although this patch is well-tested and suitable for use in production environments, you should keep in mind that high/medium/low priority event processing is different from the original code. For each priority level, if at least one ready event of a higher priority was processed, then only one event of the current priority level is processed. Otherwise, all ready events of the current priority level are processed. This ensures lower priority events do not starve. |
Revision History | ||
---|---|---|
Revision spread-5.0.0-1.0 | 2017-02-01 | |
Renamed patch after merging 5.0.0 changes, which left patch unchanged. | ||
Revision spread-5.0.0rc2-1.1 | 2017-01-27 | |
Added | ||
Revision spread-5.0.0rc2-1.0 | 2017-01-26 | |
Merged Spread 5.0.0rc2 changes. | ||
Revision spread-5.0.0rc1-1.4 | 2017-01-07 | |
Simplified handle_events() and eliminated potentially incorrect event caching. | ||
Revision spread-5.0.0rc1-1.3 | 2017-01-07 | |
Made Replaced session hash table with O(1) directly-indexed array lookup. | ||
Revision spread-5.0.0rc1-1.2 | 2017-01-06 | |
Initialized uninitialized network.c globals to zero. Removed no-op protocol functions Moved Removed unused mbox parameter
from Replaced instances
of Fixed bug where old data could be written to newly assigned session. Do not execute inactive events
in | ||
Revision spread-5.0.0rc1-1.1 | 2017-01-01 | |
Changed epoll implementation
of Corrected handling of priority event queues to process pending events. | ||
Revision spread-5.0.0rc1-1.0 | 2017-12-30 | |
Fixed FreeBSD compilation error in daemon/ tree
( Increased Removed extra Added first draft of kqueue/epoll support based on prior 4.x patches. Added first draft of poll client patch based on prior 4.x patches. Fixed fixpaths to work with Perl 5.22. Corrected priority and fd_type range checking in events.c. Fixed daemon session log initialization sequence. Restored functioning of loopback config file and fixed FreeBSD scope id. |