IOCP is definitely the way to go for efficient handling of network
traffic, I’ve easily had over 800 MB/s sustained using that model.
select() on Windows is not the horror it used to be. Back in the first
days of Winsock 1.x it genuinely was implemented as a polling loop,
which is why things like the EventSelect mechanism was created and
articles recommended avoiding select() on Windows altogether.
When Winsock was ported to the NT 4 code base the internal
implementation of select() did change to waiting on handles, though the
implementation for LSP’s using non-system handles had to wait years for
SP4 to be brought in to that fold.
The upshot is that generally select() is fine at 1 Gb/s network speeds
but above that the efficiency of IOCP makes a big difference.
One other thing comes to mind, the app isn’t using call back functions
for send/recv is it ? These look like a great idea but in practice they
perform abysmally due to the fact that callback has to operate in the
same thread context as the original call to send/recv. So if the thread
doesn’t go in to a wait state callback delivery can be delayed to a very
significant degree.
Mark.
On 06/12/2011 23:49, m wrote:
What kind of IO model does the application use? For this kind of
demanding, and inherently stateless, IO, I would recommend using an
IOCP and pending several IOPs at all times. The exact number to pend
should depend on available resources (RAM, number of CPUs, OS version
are the key factors). If the application uses the select model (worst
perf on Windows) or sync IO (baseline perf on Windows), the context
switch delay can be significant.
BTW on newer OSes, the IOCP model is encapsulated in work queue APIs
wrote in message news:xxxxx@ntdev…
We have an NDIS Intermediate driver and we were seeing packet delays.
Our tests showed that the delay was in the delivery of the packet to
the application. From the time our driver indicated the packet up the
stack until it was received by an application we saw up to 8 seconds
of delay during high CPU or high disk usage. Delay during file
transfer could be due to the disk having priority over delivery of
packets. For XP and older OS’s both network and disk are handled only
by CPU0.
Larry C