EPOLL Server
A Linux epoll acceptor for high concurrency. Handle thousands of connections on the sgcWebSockets server using a limited pool of threads instead of one thread per connection as Indy does by default.
A Linux epoll acceptor for high concurrency. Handle thousands of connections on the sgcWebSockets server using a limited pool of threads instead of one thread per connection as Indy does by default.
A high-performance I/O mode for Indy-based servers on Linux. Enable epoll on the standard server through the IOHandlerOptions property and scale far beyond the one-thread-per-connection model.
TsgcWebSocketServer / TsgcWebSocketHTTPServer — enabled via IOHandlerOptions
Linux epoll thread-pool acceptor — Linux only
Linux
Enterprise
Select iohEPOLL on the IOHandlerOptions property of an Indy server to switch from the default thread model to the epoll thread pool.
Server.IOHandlerOptions.IOHandlerType := iohEPOLL;
Server.IOHandlerOptions.EPOLL.EPOLLThreads := 0;
Server.IOHandlerOptions.EPOLL.WorkOpThreads := 0;
Server->IOHandlerOptions->IOHandlerType = iohEPOLL;
Server->IOHandlerOptions->EPOLL->EPOLLThreads = 0;
Server->IOHandlerOptions->EPOLL->WorkOpThreads = 0;
Server.IOHandlerOptions.IOHandlerType = iohEPOLL;
Server.IOHandlerOptions.EPOLL.EPOLLThreads = 0;
Server.IOHandlerOptions.EPOLL.WorkOpThreads = 0;
How the epoll thread pool works and how to tune it for your workload.
Handle thousands of connections using a limited pool of threads instead of one thread per connection. Asynchronous (overlapped) requests are dispatched across the pool rather than dedicating a thread to each socket.
Threads used for EPOLL asynchronous requests. The default value 0 means the count is calculated from the number of processors. On Delphi 7 and 2007 the default is 32 because cpucount is not supported. Adjust manually when needed.
By default each request for a connection can run on a different pool thread. Set WorkOpThreads to pin every connection to the same thread. This impacts performance, so set a value greater than zero only when you require this feature.
Recommended when you need to handle thousands of connections. If your server handles a maximum of around 100 concurrent connections, you can stay with the default Indy thread model.
EPOLL detects a dead socket only on write. To raise OnDisconnect, enable CleanDisconnect := True on TsgcWebSocketClient, or enable a server-side heartbeat that pings clients periodically.
Raise the open-file-descriptor cap to increase the number of concurrent open connections. ulimit -n 10000 sets the maximum number of open file descriptors to 10000.
Authoritative sources for the mechanism this mode relies on.
Deep-link to the online help, grab the ready-to-run demo project, and read the full manual.
| Online Help — EPOLL Full feature reference with code samples for Delphi, C++ Builder and .NET. | Open | |
| Demo Project — Demos\Server Ready-to-run example project. Ships inside the sgcWebSockets package — download the trial below. | Open | |
| User Manual (PDF) Comprehensive manual covering every component in the library. | Open |