Linux kernel parameter tuning method

  • 2020-06-19 12:31:20
  • OfStack

ulimit set

ulimit-n to 100,000 or more. Modify by executing ES6en-ES7en 100000 from the command line. If you can't modify, need to set up/etc security/limits conf, to join

* soft nofile 262140
* hard nofile 262140
root soft nofile 262140
root hard nofile 262140
* soft core unlimited
* hard core unlimited
root soft core unlimited
root hard core unlimited
Note that after you modify the ES30en.conf file, you need to restart the system to take effect

The kernel Settings

There are three ways for the Linux operating system to modify kernel parameters:

Modify /etc/ sysctl.conf file, add configuration options, format as key = value, call ES44en-ES45en to load the new configuration after modification and save
Use the sysctl command to make temporary modifications, such as sysctl-ES49en ES50en.es51EN4.tcp_ES53en ="379008 505344 758016"
Directly modify files in /proc/sys/ directory, e.g. echo "379008 505344 758016" > /proc/sys/net/ipv4/tcp_mem
The first method will automatically take effect after the operating system restarts, and the second and third methods will fail after the restart


Related articles: