?
Solved

Fastest components for high-load TCP server

Posted on 2004-10-28
3
Medium Priority
?
379 Views
Last Modified: 2010-05-18
Dear Experts,

Please share your opinion about fastest TCP/IP components/libraries to write high-load TCP server. Indy? PowerTCP? ... ?
Also, what stress tools could you recommend?

TIA,
dumb
0
Comment
Question by:iam_dumb
  • 2
3 Comments
 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 12437479
To keep it simple... I think the most important thing to keep an eye on is the speed of your network connection and the ease that those components allow you to create whatever you need. And since most TCP/IP components are just plain wrappers around the WinSock library, you could get a huge performance increase by keeping your own code as optimized for speed as possible.
0
 

Author Comment

by:iam_dumb
ID: 12437764
Yes, I've noticed that they mostly wrappers, but some of them uses some unusual things like fibers and IOCP (Indy10), but I was unable to test it since it still under heavy development. I'm not sure if these technologies will have any advantage for my server. What guru says?
0
 
LVL 17

Accepted Solution

by:
Wim ten Brink earned 1000 total points
ID: 12456715
In general, TCP/IP is best used in an asynchronous way, meaning that you send a command and just keep running without waiting for a response. Sooner or later you will get a response and this needs to be handled, of course. The reason for this is of course the slowness of the network. The system can process data much faster than the network can send it. Thus, the first preference would be a component set that works asynchronous.

The use of IOCTL, fibers and threads is one good way to deal with these things. I still prefer to use Indy 9 at the moment but the generic setup I use is that I use one idTCPClient for client-side applications but I will have two threads dealing with it. One thread that continuously waits for a message and a second one that will send the commands to the server. For the server-side, you'd be using an idTCPServer component and basically, all this component will be doing is waiting for a command, do some processing and then send a response back. This is best done with a single thread for every connection and basically, you're not going to send data without the client asking for any. Indy is offering multi-threading support for these server-components, which basically means that one connection doesn't interfere with another connection, as long as you remember that you're dealing with a multi-threaded environment.

A thread pool like Indy offers could be useful since it sometimes will reuse a thread instead of destroying it. Not too useful if you have a huge amount of different connections at the same time because it will be somewhat limiting in those situations, but when you have a large amount of connections coming one after the other, a pool would be pretty useful.

But most important of all is not the choice of the component but becoming very familiar with the technique and knowing where to gain the performance increase you need. Sometimes it just helps to add more RAM or a faster disk. Other times, you have to go deep in your code and alter some string-handling routines just to squeeze a bit of performance out of them. It's not easy...
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
How to fix display issue, screen flickering issue when I plug in power cord to the machine. Before I start explaining the solution lets check out once the issue how it looks like after I connect the power cord. most of you also have faced this…
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.

594 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question