I found this information that talks about tcp_adv_win_scale
. The page is titled: TCP performance tuning - how to tune linux.
excerpt
TCP performance is limited by latency and window size (and overhead, which
reduces the effective window size) by window_size/RTT (this is how much data
that can be "in transit" over the link at any given moment).
To get the actual transfer speeds possible you have to divide the resulting
window by the latency (in seconds):
The overhead is: window/2^tcp_adv_win_scale (tcp_adv_win_scale default is 2)
So for linux default parameters for the recieve window (tcp_rmem):
87380 - (87380 / 2^2) = 65536.
Given a transatlantic link (150 ms RTT), the maximum performance ends up at:
65536/0.150 = 436906 bytes/s or about 400 kbyte/s, which is really slow today.
With the increased default size:
(873800 - 873800/2^2)/0.150 = 4369000 bytes/s, or about 4Mbytes/s, which
is resonable for a modern network. And note that this is the default, if
the sender is configured with a larger window size it will happily scale
up to 10 times this (8738000*0.75/0.150 = ~40Mbytes/s), pretty good for
a modern network.
2.6.17 and later have resonably good defaults values, and actually tune
the window size up to the max allowed, if the other side supports it. So
since then most of this guide is not needed. For good long-haul throughput
the maxiumum value might need to be increased though.
I was able to follow that but didn't quite understand the relationship, if any, between these 2 variables.
I only marginally understood what that was trying to explain. At the core it sounds like this parameter to scale the amount of buffering space is to be used for TCP and for the application.
Searching a bit more I found these explanations which made more sense. The page was titled: Ipsysctl tutorial 1.0.4 - Chapter 3. IPv4 variable reference.
excerpt
3.3.2. tcp_adv_win_scale
This variable is used to tell the kernel how much of the socket buffer space should be used for TCP window size, and how much to save for an application buffer. If tcp_adv_win_scale is negative, the following equation is used to calculate the buffer overhead for window scaling:
Where bytes are the amount of bytes in the window. If the tcp_adv_win_scale value is positive, the following equation is used to calculate the buffer overhead:
The tcp_adv_win_scale variable takes an integer value and is per default set to 2. This in turn means that the application buffer is 1/4th of the total buffer space specified in the tcp_rmem variable.
3.3.3. tcp_app_win
This variable tells the kernel how many bytes to reserve for a specific TCP window in the TCP sockets memory buffer where the specific TCP window is transfered in. This value is used in a calculation that specifies how much of the buffer space to reserve that looks as the following:
As you may understand from the above calculation, the larger this value gets, the smaller will the buffer space be for the specific window. The only exception to this calculation is 0, which tells the kernel to reserve no space for this specific connection. The default value for this variable is 31 and should in general be a good value. Do not change this value unless you know what you are doing.
Based on these explanations it sounds like the first parameter, tcp_adv_win_scale
is controlling the split of the socket buffer space in terms of how it get's carved up for TCP window use vs. application buffer.
Whereas the 2nd parameter, tcp_app_win
is specifying the number of bytes to reserve for the application buffer mentioned in the tcp_adv_win_scale
description.