3

I have several Windows Server 2008 R2 machines that act as clients and are connected to another server in the same datacenter. I don't have access to teh server. I need to minimize latency between clients and the server. They communicate via Macromedia Flash (Winsockets) and exchange very small commands (20-30 bytes). The usual latency is 200-400 microseconds, but from my experience and from some tests (done with MS Network Monitor) it seems that in the Flash application the response times are very often several milliseconds, at leaset, and this is not due to the software.

I suspect it could be because of Nagle algorithm or delayed ACKs. I tried disabling both via the registry, but it doesn't seem to have effect on Server 2008 R2. I know I can tweak MTU and some other values with the registry: DefaultSendWindow, DefaultReceiveWindow, GlobalMaxTcpWindowSize, TcpWindowSize. I assume I should try to set the sending buffer to 0 and receiving buffer to a large value, is this the right strategy?

I have the fastest CPU I could get, I disabled Interrupt moderation for the Network Card, what else can I do to minimize latency? Even 100microseconds is important for me.

Yekoor
  • 31
  • 1
  • 4
  • 1
    `it seems that in the Flash application the response times are very often several milliseconds, at leaset, and this is not due to the software.` - How did you determine that? – joeqwerty Dec 06 '14 at 00:01
  • I slowed down some clients by 1-3ms and they still get responses before the other clients in a random manner, even though the ping is constantly 200-400us. Besides, I can see in MS Network Monitor how the commands that I send accumulate to about 1450bytes before being sent. – Yekoor Dec 06 '14 at 00:15

2 Answers2

4

Here is Microsoft's Performance Tuning Guidelines document for Windows Server 2008 R2:

http://download.microsoft.com/download/6/B/2/6B2EBD3A-302E-4553-AC00-9885BBF31E21/Perf-tun-srv-R2.docx

There are 136 pages of performance tuning guidelines in that document.

You might also get some interesting info from support.microsoft.com/kb/214397/en-us

You might also try disabling the Windows Filtering Platform, which is not generally recommended but it might help shorten the I/O's journey through the operating system.

You also have a slew of technologies that Microsoft has baked into Windows that were specifically geared toward low-latency networking, though most of these are specific improvements in 2012, not for 2008 R2:

http://technet.microsoft.com/en-us/library/hh831415.aspx

  1. Data Center Bridging

  2. Data Center Transmission Control Protocol (DCTCP)

  3. Kernel Mode Remote Direct Memory Access (kRDMA)

  4. Network Interface Card (NIC) Teaming

  5. NetworkDirect

  6. Receive Segment Coalescing (RSC)

  7. Receive Side Scaling (RSS)

  8. Registered Input/Output (RIO) API Extensions

  9. Transmission Control Protocol (TCP) Loopback Optimization

  10. Low Latency Workloads Management and Operations

But there's only so much that you'll be able to do with software tweaking. Simply by upgrading your hardware to Infiniband/RDMA over Converged Ethernet, you'll get drastic reductions in latency that you'll never be able to achieve by flipping bits in the Windows registry.

Finally, here's something that's a little more directly answering your question about delayed ACK. I don't know if that's really your problem or not, but:

Subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\

Entry: TcpAckFrequency

Value Type: REG_DWORD, number Valid Range: 0-255 Default: 2
Description: Specifies the number of ACKs that will be outstanding before the delayed ACK timer is ignored. Microsoft does not recommend changing the default value without careful study of the environment.

If you set the value to 1, every packet is acknowledged immediately because there is only one outstanding TCP ACK as a segment is just received. The value of 0 (zero) is not valid and is treated as the default, 2. The only time the ACK number is 0 is when a segment is not received and the host is not going to acknowledge the data.

Ryan Ries
  • 55,011
  • 9
  • 138
  • 197
  • Thanks, I have already read "Performance Tuning Guidelines" and I tried that registry modification, unfortunately it doesn't seem to have any affect on Server 2008 R2. As for the other tips/technologies I will have a look at them, thanks. – Yekoor Dec 06 '14 at 01:51
  • 1
    @Troman You might also get some interesting info from http://support.microsoft.com/kb/214397/en-us – Ryan Ries Dec 06 '14 at 21:44
2

Start by disabling large send offload, the network stack wait to send the packet to fill the buffer, with the option at off it send more small packets, but help for speed intensive app.

yagmoth555
  • 16,300
  • 4
  • 26
  • 48