Network send performance

OK, so how *do* you get decent throughput when wishing to send large amounts
of data to/from an NT system ?
Winsock performance seems exceptionally poor (maybe because there are many
UM to KM transitions ?). Are there any secret methods to getting good
performance ? This is strictly for TCP/IP communication.

Regards,

Paul Bunn, UltraBac.com, 425-644-6000
Microsoft MVP - WindowsNT/2000
http://www.ultrabac.com

> OK, so how *do* you get decent throughput when wishing to

send large amounts
of data to/from an NT system ?

A lot of it has to do with your Ethernet NIC. The newer / higher-end cards
use “interrupt mitigation” where, instead of having one interrupt per packet
sent or received, it switches to a polling (or interrupt every N packets)
method. This works because it not only reduces the interrupt overhead, but
there is an NDIS API to handle multiple packets at a time, which is a bit
more efficient.

This can surprisingly increase the throughput by 2 or 3 times!

You can check this out on your system by using Performance Monitor, monitor
the Processor - Interrupts per second statistic and see if it increases
linearly with your network traffic.

> Winsock performance seems exceptionally poor (maybe because there are many

UM to KM transitions ?). Are there any secret methods to getting good
performance ? This is strictly for TCP/IP communication.

IIRC there was a way in WinSock to set the TCP sender window size to 0.
(setsockopt() IIRC).
In this mode, send() returns only when an acknowlegdement will arrive to
the data being sent. So, never send data in small pieces in this mode.
But in this mode IIRC tcpip.sys does not use any memcpy to send the data -
the MDL built on the user buffer in question is passed down to NDIS.

Max