
Hi, We need to develop a server in a LAN environment, in which the number of connections at a time will be less, but the data traffic per connection will be huge (gigabytes). So for the best performance which library is better? ASIO or Thread? Is thre is any specif advice for attaining the maximum performace (data rate)? I am a newbie. Thanks, Lloyd ______________________________________ Scanned and protected by Email scanner

On Thu, Nov 5, 2009 at 11:09 PM, Lloyd
Hi, We need to develop a server in a LAN environment, in which the number of connections at a time will be less, but the data traffic per connection will be huge (gigabytes). So for the best performance which library is better? ASIO or Thread?
Is thre is any specif advice for attaining the maximum performace (data rate)? I am a newbie.
Since you generally use ASIO *with* Threads, I would imagine that would be best, and if you set it up asynchronously, then I would say that the number of threads equaling the number of CPU cores in the computer would be best. Might wait for an expert though.

On Sat, Nov 7, 2009 at 6:34 PM, OvermindDL1
On Thu, Nov 5, 2009 at 11:09 PM, Lloyd
wrote: We need to develop a server in a LAN environment, in which the number of connections at a time will be less, but the data traffic per connection will be huge (gigabytes). <snip> Since you generally use ASIO *with* Threads, I would imagine that would be best, <snip>
Yeah, the question is more like: Should I use ASIO+Threads, or just ASIO?
and if you set it up asynchronously, then I would say that the number of threads equaling the number of CPU cores in the computer would be best.
I'm betting your performance will be bound by disk IO, unless your link throughput is ridiculously low. Either way, since you're expecting relatively few simultaneous connections, I'm not sure that extra threads beyond what the ASIO io_service uses will buy you anything. But you should always benchmark to be sure. Jon

Lloyd wrote:
Hi, We need to develop a server in a LAN environment, in which the number of connections at a time will be less, but the data traffic per connection will be huge (gigabytes). So for the best performance which library is better? ASIO or Thread?
Is thre is any specif advice for attaining the maximum performace (data rate)? I am a newbie.
I would suggest you write a first draft, or spike solution, to test speed and then do some calculations to see whether or not the speed is acceptable for your problem before looking for optimisation hints. Regards, n

Lloyd
We need to develop a server in a LAN environment, in which the number of connections at a time will be less, but the data traffic per connection will be huge (gigabytes). So for the best performance which library is better? ASIO or Thread?
Hi Lloyd, ASIO can do its work in any number of worker threads, and you can adjust the number of worker threads without too much work, so it should be easy to experiment. Hope this helps, -----Scott.

On Fri, Nov 6, 2009 at 12:09 AM, Lloyd
Hi, We need to develop a server in a LAN environment, in which the number of connections at a time will be less, but the data traffic per connection will be huge (gigabytes). So for the best performance which library is better? ASIO or Thread?
Is thre is any specif advice for attaining the maximum performace (data rate)? I am a newbie.
Thanks, Lloyd
Unless you are doing lots of non-disk related stuff with the data, there is no point in using multiple threads. What will the threads even do? disk i/o is issued as an asynchronous system call which returns immediately, so having multiple threads all returning immediately and then waiting for work doesn't serve much purpose. If, on the other hand, you are doing computation on the data then you can use multiple threads. I use asio in exactly this way. One thread doing all the I/O from the disk, then a thread pool of boost::thread::hardware_concurrency() threads encrypting and computing MD5 sums of data, then passing that to the next stage of the pipeline which is back in the original main application thread which dumps it to a socket asynchronously. So all the i/o (disk / network) is on a single thread, and all the computation is in a thread pool.
participants (6)
-
Jonathan Franklin
-
Lloyd
-
Nigel Rantor
-
OvermindDL1
-
Scott Gifford
-
Zachary Turner