Reduce network latency when sharing applications with large intranet volume

We have a set of server applications that receive measurement data from equipment / tools. Messaging time is currently our main bottleneck, so we are interested in reducing it to improve the process. Communication between tools and server applications is via TCP / IP sockets created using C ++ on Redhat Linux.

Is it possible to reduce message transmission time using hardware by changing the TCP / IP configuration settings or by changing the tcp kernel functions? (we can sacrifice security for speed because the connection is on a secure intranet)

+4
source share
5 answers

Depending on the workload, disabling the Nagle algorithm on the socket may help.

When working with large volumes of small messages, I found that it was of great importance.

From memory, I believe that the socket option for C ++ was called by TCP_NODELAY

+5
source

As @Jerry Coffin suggested, you can switch to UDP . UDP is an unreliable protocol, which means you may lose your packets, or they may come in the wrong order or duplicated. Therefore, you need to handle these cases at the application level. Since you may lose some data (as you indicated in your comment), there is no need for retransmission (the most difficult part of any reliable protocol). You just need to discard outdated packages. Use simple numbering in sequence and you're done.

Yes, you can use RTP (it has serial numbering), but you do not need it. RTP looks like redundant for your simple case. It has many other features and is mainly used for streaming media.

[EDIT] and similar question here

+2
source

On the hardware side, try the Intel NIC server and verify that the TCP engine (ToE) is disabled.

There is also an important decision to make between latency and goodput if you want better latency due to sufficiency to take into account the reduction in interruption of the coalescing period. See the Intel documentation for more information as they offer quite a few customizable options.

+1
source

If you can, then the obvious step to reduce latency is to switch from TCP to UDP.

0
source

Yes.

Google "TCP Frame Size" for details.

-1
source

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


All Articles