By Admin on Wednesday, 08 January 2020
Category: Features

Indy IOCP Server

Indy servers use one thread for every connection, this means that if your server must handle 1000 concurrent connections, it will create 1000 threads. But if instead of 1000 connections there are 10.000 connections, it creates 10.000 threads and so on... of course, this requires exponential hardware resources and it's not usable for high load servers.

Windows provides an API, called IOCP, which allows to handle with a small pool of threads thousands of connections. 

From sgcWebSockets 4.3.3 IOCP is supported by Indy Servers:

Configuration

 IOCP To enable IOCP for Indy Servers, Go to IOHandlerOptions property and select iohIOCP as IOHandler Type.

IOCPThreads are the threads used for IOCP asynchronous requests (overlapped operations) and WorkOpThreads are threads used to process these asynchronous requests (read and write bytes). Maximum value of WorkOpThreads is 64, but you must adjust this value accordingly to your number of physical processors * 2, so if you have a cpu with 16 processors, set a WorkOpThreads value of 32. Enabling IOCP for windows servers is recommended when you need handle thousands of connections, if your server is only handling 100 concurrent connections at maximum you can stay with default Indy Thread model. 

Related Posts