Learn how to enable TCP Selective Acknowledgment (SACK) on a Linux instance.
If TCP SACK is disabled, the network performance of your Linux instance might be degraded. Follow the steps in this topic to enable it.
Procedure
The steps in this topic use CentOS 7.4 as an example. The procedure may vary for other operating systems. For specific instructions, consult your OS's official documentation.
-
Connect to the Linux instance using VNC.
For more information, see Connect using VNC.
-
Edit the
/etc/sysctl.conffile:vim /etc/sysctl.conf -
Enable TCP SACK.
-
If the
net.ipv4.tcp_sackparameter already exists:-
Press the
ikey to enter Insert mode. -
Change
net.ipv4.tcp_sack = Xtonet.ipv4.tcp_sack = 1. -
To save the file and exit, press the
Esckey, type:wq, and then press theEnterkey.
-
-
If the
net.ipv4.tcp_sackparameter does not exist:-
Press the
ikey to enter Insert mode. -
Add the following to the end of the file:
net.ipv4.tcp_sack = 1Your file should now look similar to the following:
net.ipv4.conf.default.arp_announce = 2 net.ipv4.conf.lo.arp_announce = 2 net.ipv4.conf.all.arp_announce = 2 # see details in https://help.aliyun.com/knowledge_detail/41334.html net.ipv4.tcp_max_tw_buckets = 5000 net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_max_syn_backlog = 1024 net.ipv4.tcp_synack_retries = 2 net.ipv6.conf.all.disable_ipv6 = 0 net.ipv6.conf.default.disable_ipv6 = 0 net.ipv6.conf.lo.disable_ipv6 = 0 kernel.sysrq = 1 net.ipv4.tcp_sack = 1 -
To save the file and exit, press the Esc key, type
:wq, and then press theEnterkey.
-
-
-
Apply the changes:
sysctl -p