All Products
Search
Document Center

:How to enable TCP ack for a Linux instance

Last Updated:Dec 29, 2020

Introduction

If TCP SACK is disabled for a Linux instance, the network performance of the instance may be affected. You can use the steps in this topic to enable TCP ack.

Background

Alibaba Cloud reminds you that:

  • Before you perform operations that may cause risks, such as modifying instance configurations or data, we recommend that you check the disaster recovery and fault tolerance capabilities of the instances to ensure data security.
  • You can modify the configurations and data of instances including but not limited to Elastic Compute Service (ECS) and Relational Database Service (RDS) instances. Before the modification, we recommend that you create snapshots or enable RDS log backup.
  • If you have authorized or submitted sensitive information such as the logon account and password in the Alibaba Cloud Management Console, we recommend that you modify such information in a timely manner.

The content of this article has been verified in the CentOS 7.4 version of the system, and may be slightly different in other versions. For more information, see the official documentation for the version.

  1. Remotely log on to the Linux instance through VNC. For more information about how to log on remotely, see ECS connection methods overview.
  2. Run the following command to edit the /etc/sysctl.conf file:
    vim /etc/sysctl.conf
  3. Enable TCP ack:
    • If A net.ipv4.tcp_sack-related configuration exists, press A key and change net.ipv4.tcp_ack=X to net.ipv4.tcp_ack=1. Press the Esc key to exit the edit mode. Enter : WQ, press Enter, save and exit.
      Note: the colon (:) in : WQ needs to be output by pressing Shift + colon (:).

    • If the net.ipv4.tcp_sack configuration does not exist, press the key, add the following configuration, and then press Esc to exit the editing mode. Enter : WQ, press Enter, save and exit.
      net.ipv4.tcp_sack = 1
      The following command output is returned.


  4. Run the following command to make the configuration take effect.
    sysctl -p

Application scope

  • Elastic Compute Service