How can TCP be configured for high-performance one-way transmission?

my (network) client sends 50 to 100 KB of data packets every 200 ms to my server. There are up to 300 customers. The server does not send anything to the client. Server (dedicated) and clients are on the local network. How to tune TCP for better performance? Server on Windows Server 2003 or 2008, clients on Windows 2000 and higher.

eg. TCP window size. Does changing this setting help? anything else? any special socket options?

[EDIT]: in fact, in different modes, packages can be up to 5 MB

+2
source share
3 answers

I learned this a couple of years ago with 1700 data points. The conclusion was that the only thing you can do is set up a huge socket receive buffer (for example, 512k) in the receiver. Make it into the listening slot so that it is inherited by the accepted sockets, so it will already be installed when they are acknowledged. This, in turn, allows you to coordinate the scaling of the TCP window during a handshake, which allows the client to find out the window size> 64k. The huge size of the window basically allows the client to transmit as fast as possible, provided that only avoidance of overflow, and not closed reception windows.

+5
source

What is an OS? IPv4 or v6? Why such a big dump; why can't it be broken?

Assuming reliable, stable, low bandwidth: latency, you can configure settings such as backlight size, initial window size, mtu (depending on data, IP version and [tcp / udp] mode.

You can also combine robin or balance inputs, so you have less interrupt time from nic .. binding is also an option.

5 MB / package /? This is a pretty bad design .. I would have thought that this would lead to a lot of relay segments, and the LOT from the kernel / mem stack is used in the recovery / retransmission sequence (accept latency, etc.).

(Is it possible?)

+1
source

Since all the clients are on the local network, you can try to enable "jumbo frames" (for this you need to run the netsh command), you will need to use Google for the exact command, but there are many instructions).

At the application level, you can use TransmitFile, which is the equivalent of the Windows sendfile and works fine in Windows Server 2003 (it is artificially limited with a restriction in the "non-server" section, but this will not be a problem for you). Please note that you can use a memory mapped file if you generate data on the fly.

As for the settings, an increase in the send buffer will most likely not do you any good, although an increase in the number of received buffers may help in some cases, since it reduces the likelihood of packets being deleted if the receiving application does not process incoming data quickly enough. A larger TCP window size (registry setting) may help, as it allows the sender to send more data before it needs to be blocked until the ACK arrives.

A nuclear quota for program working groups can cost attention, it costs nothing and can be an advantage, since the kernel needs to block pages when they are sent. If you are allowed to have more blocked pages, maybe something is faster (or maybe not, but that won't hurt either), by default it's still funny).

+1
source

Source: https://habr.com/ru/post/1345478/


All Articles