> I'm currently using Indy to communicate with TCP/IP devices. We have about
> 30000 devices and growing. We're getting to the point where the number 
> of concurrent connections are too many too handle for a single Indy server

> instance. I have to start looking at load balancing but before I do that I
want to 
> have a look a asynchronous sockets.

> In extreme cases we have about 3000 concurrent connections but
>  Indy can't cope with that so we limit it to 1000 and queue the remainder.

Using ICS with a large number of connections, you use a list of threads.
Each thread can handle hundreds or thousands of connections (TWSocket). The
number of connections per thread depends mainly on the traffic load, not the
number of connections. If each connection sit idle for most of the time,
then a single thread can handle 1000 or 2000 of them. 

ICS doesn't impose any limit in the number of connections. The limits are
only at the Windows operating system which imposes a limit on the number of
simultaneous open handles (A socket is seen as a handle). The limit depends
on the Windows edition. A server edition has a much higher limit.

Another OS limit is the size of non paged memory pool. Each socket takes
some byte there. To support a high number of concurrent sockets, you must
have a lot of memory (Non paged memory size depends on the total memory

Use TWSocketThrdServer component to automatically handle thread creation.
You specify how many client per thread you want and the component does it
for you.

Please note that if the work requested by a client implies a blocking
process, such as a long SQL query, then you MUST use a separate worker
thread to execute that lengthy process, or use Windows Asynchronous I/O. if
you don't do that, while a thread is blocked handling your processing, then
no other connection handled by that blocked thread will do anything. You
really must think asynchronous programming everywhere.


The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)

To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to