The settings net.ipv4.tcp_no_ssthresh_metrics_save and net.ipv4.tcp_no_metrics_save are related to the Linux kernel's handling of TCP connections, but they serve slightly different purposes in terms of the metrics they control. Both settings influence the performance optimization strategies of TCP connections, yet they focus on different aspects of these connections.
net.ipv4.tcp_no_metrics_save
This setting controls whether the Linux TCP stack saves various connection metrics between different TCP connections to the same destination. These metrics can include round-trip time (RTT), the packet loss rate, and the ssthresh (slow start threshold, which controls the transition between slow start and congestion avoidance states in the TCP congestion control algorithm). When set to 0 (disabled), the kernel saves these metrics at the end of a connection and reuses them for new connections to the same destination, aiming to optimize the initial parameters of these new connections based on past performance. This preemption enables faster connection setup and can improve overall data throughput.
net.ipv4.tcp_no_ssthresh_metrics_save
On the other hand, net.ipv4.tcp_no_ssthresh_metrics_save is more specific in its focus. It controls whether the Linux kernel saves the slow start threshold (ssthresh) metric specifically between TCP connections to the same destination. The slow start threshold is a crucial parameter in controlling how aggressively TCP increases its congestion window size, which in turn affects how quickly it can send data. When this setting is disabled (set to 0), the kernel saves the ssthresh value at the end of a connection to use in future connections to the same destination, potentially skipping some of the slow start phase if the previous value indicates the network can handle a larger initial congestion window.
Differences and Purposes
While both settings are related to optimizing TCP performance by leveraging historical connection metrics, the key difference lies in their scope:
net.ipv4.tcp_no_metrics_save affects the saving and reusing of a broad set of connection metrics.
net.ipv4.tcp_no_ssthresh_metrics_save is specifically targeted at the slow start threshold metric.
Similar Purpose: Both aim to optimize the performance of TCP connections by applying learned information from previous connections to subsequent ones to the same destination. This optimization can lead to faster data transmission and less conservative use of network capacity.
Differences: The main difference is in the specific metrics they control. One is more general, affecting a broad set of metrics, while the other is singularly focused on the slow start threshold.
In practice, adjusting these settings depends on the particular network conditions, the type of traffic commonly encountered, and the performance characteristics you wish to optimize for. Monitoring and experimentation in your specific environment are key to determining the most beneficial configuration.