NamoRamana 3 Posted November 6, 2019 Hi, Can a TCP File Server written using TWSocketServer be effective for serving hundreds of clients? Typically, when a client connects to a TCP server, the connection lasts for bit long time and during that time, more than 100+ files, each of few MB, are served. Since ICS TCP server component is asynchronous and non-blocking, I was wondering, if any time-consuming operation on server can be implemented without threads. Any example would be appreciated. Share this post Link to post
Angus Robertson 577 Posted November 6, 2019 Yes, TWSocketServer has been tested with hundreds of clients, the main limit is how many new clients can connect each second, particularly with SSL which has a high connection overhead. Once connected, lots of large files can be download in parallel. But blocking the server with SQL requests, SHA1 sums, etc, will stop new connections, file I/O, etc, The ICS FTP server uses a thread for such operations. The ICS web and FTP servers are good examples, although quite complicated. Angus Share this post Link to post
Fr0sT.Brutal 900 Posted November 7, 2019 11 hours ago, NamoRamana said: if any time-consuming operation on server can be implemented without threads It can as long as it's asynchronous 😄 Share this post Link to post
Angus Robertson 577 Posted November 7, 2019 If you want to do some ICS stress testing, you can use my ComCap5 and ComGen5 tools, the former is a general purpose data capture tool, the latter generates streams of TCP or UDP data to test the former. I tested ComGen5 creating 2,000 sessions to ComCap5, with 100 new connections per second (which is configurable) with ComCap5 saving data from all the connections into the same log file. Both tools use a single thread for all the connections. ComGen5 uses an array of TIcsIpStrmLog components to make the TCP client connections to TWSocketServer in ComCap5. SSL slows down the number of new connections per second, with about 300 out of 2,000 failing first time, but TIcsIpStrmLog retries failed connections so the session start on the next attempt. Angus Share this post Link to post
FPiette 385 Posted November 7, 2019 On 11/6/2019 at 8:17 PM, NamoRamana said: if any time-consuming operation on server can be implemented without threads. In any application, any time-consuming operation can be implemented without thread by correctly making use of cooperative multitasking of Windows. That is use asynchronous operation. Any computing time taking significant time has to be divided in small chunk allowing other processing to take place. Any blocking task can be rewritten to work asynchronously by using worker threads. If you have to support a large number of concurrent and active clients, you'd better have a sufficient hardware. A simple desktop PC won't support the load. Use a real hardware server with multiple Intel Xeon and a huge memory (Something like 128GB of RAM look OK). Also think about network bandwidth and disk I/O throughput. Not all 1Gbps Ethernet adapter are actually able to sustain that speed. Maybe a 10Gbps network card is required with sufficient power on the adapter itself. About the disk, think about SSD but pay attention that they are not all equals, and if you need hard disks, they are also not all equal! Use 15krpm and high speed SAS disk adapter with lot of cache. Don't forget that RAID takes time. Use RAID1 which is less efficient that RAID5 in term of usable capacity, but is much faster. To summarize, you have to write the best software and run it on the best hardware to get the best performances. It is likely that the overall performance will be similar to the weakest piece in the chain. Share this post Link to post