This topic describes the optimized configurations and common system configuration parameters for Alibaba Cloud Linux 3. You can adjust kernel parameters to suit specific business scenarios.
Operating system limits
Alibaba Cloud Linux 3
Before you modify kernel parameters, note the following:
Adjust parameters only as needed and with supporting data. Do not adjust kernel parameters arbitrarily.
Understand the function of each parameter. Kernel parameters can differ between environment types and versions.
Optimized configurations for Alibaba Cloud Linux 3
The following system configuration parameters are optimized in Alibaba Cloud Linux 3.
Performance improvement
Configuration item | Value | Description |
| 1000 | The initial TCP retransmission timeout. The minimum value is 2 HZ. Important This is a custom feature developed for Alibaba Cloud Linux 3. Long-term maintenance is not guaranteed. This system configuration is deprecated in Alibaba Cloud Linux 4 and later. |
| 1000 | The initial timeout for SYN-ACK messages. The minimum value is 2 HZ. After the first retransmission, the timeout period doubles. Important This is a custom feature developed for Alibaba Cloud Linux 3. Long-term maintenance is not guaranteed. This system configuration is deprecated in Alibaba Cloud Linux 4 and later. |
| 120000 | The maximum SYN-ACK timeout. The minimum value is 2 HZ. When a SYN-ACK message is retransmitted, the retransmission timeout (RT) doubles with each attempt from the initial value set by Important This is a custom feature developed for Alibaba Cloud Linux 3. Long-term maintenance is not guaranteed. This system configuration is deprecated in Alibaba Cloud Linux 4 and later. |
| 40 | The ACK message timeout. This Valid values: 4 ms to 200 ms. Important This is a custom feature developed for Alibaba Cloud Linux 3. Long-term maintenance is not guaranteed. This system configuration is deprecated in Alibaba Cloud Linux 4 and later. |
| 10 | The initial size of the TCP congestion window. Important This is a custom feature developed for Alibaba Cloud Linux 3. Long-term maintenance is not guaranteed. This system configuration is deprecated in Alibaba Cloud Linux 4 and later. |
| 2 | The number of times the server retries sending a SYN-ACK message if it does not receive the final ACK message. If the network quality is good, three retries take about 7 seconds. |
| 0 | Specifies whether to re-initiate a slow start after a TCP connection becomes idle. Valid values:
|
| 0 | Controls the code enormous pages feature. Valid values:
You can enable Hugetext to reduce Important This is a custom feature developed for Alibaba Cloud Linux 3. Long-term maintenance is not guaranteed. |
Resource utilization improvement
Configuration item | Value | Description |
| 4 | The number of times the client retries sending a SYN message if it does not receive a SYN-ACK message. With an initial retransmission timeout of 1 second, four retransmissions take about 15 seconds, and the final timeout occurs after about 31 seconds. |
| 8 | Affects the total retransmission timeout for an active TCP connection that has not received an ACK message. With an initial RTO of 200 ms, eight retransmissions take about 51 seconds, and the final timeout occurs after about 102 seconds. |
| 60 | The timeout period of a TCP Valid values: 1 second to 600 seconds. For more information, see Modify the TCP TIME-WAIT timeout period. Important This is a custom feature developed for Alibaba Cloud Linux 3. Long-term maintenance is not guaranteed. This system configuration is deprecated in Alibaba Cloud Linux 4 and later. |
| 5000 | The maximum number of TCP connections allowed in the Connections in the TIME_WAIT state occupy the port range that a client uses to establish connections to a server. The maximum number of ports that can be used to connect to the same server |
Network security
Configuration item | Value | Description |
| 0 | Controls reverse path filtering for all current network interface cards (NICs). Valid values:
Warning If this parameter is set to 1, packet loss may occur. In a system with multiple NICs, packets are discarded if their inbound and outbound NICs are different. Therefore, do not enable this setting in a multi-NIC system. |
| 0 | Controls reverse path filtering for new NICs. Valid values:
Warning If this parameter is set to 1, packet loss may occur. If several NICs are equipped and the inbound port and outbound port reside on different NICs, the packets are discarded. Therefore, do not enable the reverse path filtering feature for a multi-NIC system. |
| 2 | Controls the selection of the source IP address in ARP requests for new NICs. Valid values:
|
| 2 | Controls the selection of the source IP address in ARP requests for all current NICs. Valid values:
|
| 1 | Controls SYN flood attack protection. Valid values:
|
Other common system configurations for Alibaba Cloud Linux 3
Performance improvement
Configuration item | Default value | Description |
| 32768 60999 | The port number range. When a client establishes a connection, the TCP/UDP protocol allows the local port number to be modified as needed. When most of the ports in this range are occupied, the kernel's linear search for a new port may cause high CPU utilization. |
| 4096 131072 6291456 | The size of the The initial value is independent of the instance type. The first value is the minimum size, the second is the default size, and the third is the maximum size. Increase these values based on the memory usage of the instance. |
| 4096 16384 4194304 | The size of the The initial value is independent of the instance type. The first value is the minimum size, the second is the default size, and the third is the maximum size. Increase these values based on the memory usage of the instance. |
| 1000 | The These are cache queues primarily used for receive packet steering (RPS) or intra-host communication, such as |
| 4096 | The maximum length of a For applications such as |
| 212992 | The maximum This parameter is mainly used when the kernel needs to handle many connections over a single In TCP, this option is used only when you call |
| 212992 | The maximum This is mainly used to handle many connections on a single In TCP, this option is used only when you call the |
| 0 | Specifies whether the
When I/O read and write addresses are contiguous, the kernel I/O protocol stack merges multiple I/O operations into a single large I/O using the If I/O read and write addresses are random, the chance of merging I/O operations is low. However, checking whether a merge can be performed consumes CPU cycles and affects performance. You can disable the merge feature of the device to improve performance. |
| 4096 | The The kernel sets the default value to 128 KB. The If most of the I/O load consists of random I/O, lower this value (for example, to 128 KB) to improve business performance. |
| 1 | Specifies which CPU processes the I/O completion interrupt. Valid values:
Adjust the sending method based on the I/O pressure of the system. |
|
| The I/O device scheduler. Alibaba Cloud Linux 3 supports the following schedulers: By default, the In most cases, the default settings are used. If you have special requirements, such as low read latency, you can switch to the |
| 0 | Specifies whether to enable the Page Cache limit feature in the Linux kernel. Valid values:
Important This is a custom feature developed for Alibaba Cloud Linux 3. Long-term maintenance is not guaranteed. |
| 0 | Specifies whether to enable the Page Cache Limit feature for
|
| 0 | Specifies the limit on Valid values: 0 to the
|
Network security
Configuration item | Default value | Description |
| 0 | Controls whether the system responds to external ARP requests received by all current NICs. Valid values:
For example, when |
| 0 | Controls whether the system responds to external ARP requests received by new NICs. Valid values:
For example, |
| 0 | Specifies whether to enable the
|
Resource utilization
Configuration item | Default value | Description |
| 60 | For the party that actively disconnects the This is used to wait for the peer to close the connection or to receive data from the peer. Modify this value to speed up the system's closing of TCP connections in the FIN-WAIT-2 state. In actual business scenarios, you can run the |
| 2 | Specifies whether to allow TCP connection establishment over
|
| 7200 | The interval at which This is used to confirm whether a TCP connection is valid. |
System limits
Configuration item | Default value | Description |
| 65536 | The maximum number of concurrent The value of this parameter depends on how heavily the system uses
|
| Set based on the reserved memory size during system initialization. | The maximum number of file handles that the system allows. Up to 10% of the reserved memory can be used by file handles during system initialization. The default value of this parameter must be greater than or equal to the Use the default value if you have no special requirements. |
| 1048576 | The maximum number of open file handles that a process is allowed. The limit for an application depends on |
Monitoring
Configuration item | Default value | Description |
| 262144 | The maximum number of connections supported by the hash table in the The default value is calculated using the following formula: net.netfilter.nf_conntrack_max = For more information, see What do I do if applications on an ECS instance occasionally experience packet loss and the kernel log (dmesg) contains the "kernel: nf_conntrack: table full, dropping packet" error message?. |
| 120 | The timeout period of a TCP connection in the TIME_WAIT state in the |
| 432000 | The timeout period after which an established TCP connection is closed by |
| 16384 | The maximum queue length of pending events of the
Use the default value if you have no special requirements. |
| 128 | The maximum number of This parameter is used to prevent excessive consumption of system resources such as memory due to the creation of excess Use the default value if you have no special requirements. |
| 8192 | The maximum number of A |
| 5000 | Detects I/O operations that do not return for a long time during system operation. Unit: ms. You can modify this based on specific business scenarios. For more information, see Detect I/O hangs in the file system and block layer. Important This is a custom feature developed for Alibaba Cloud Linux 3. Long-term maintenance is not guaranteed. |