[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Fastest components for high-load TCP server

Posted on 2004-10-28
3
Medium Priority
?
375 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

656 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