Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to configure optimized sysctl.conf

Shulou Source: shulou.com Published: 2022-06-01 07:50:25 11月13日 Update

This article introduces the knowledge of "how to configure optimized sysctl.conf". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Recently found a good sysctl.conf optimization parameters, in the site response has been good, time timeout connection is said to be almost 0.

System: centos 5.x

Sysctl.conf configuration parameters:

The code is as follows:

Net.ipv4.ip_forward = 0

Net.ipv4.conf.default.rp_filter = 1

Net.ipv4.conf.default.accept_source_route = 0

Kernel.sysrq = 0

Kernel.core_uses_pid = 1

Net.ipv4.tcp_syncookies = 1

Kernel.msgmnb = 65536

Kernel.msgmax = 65536

Kernel.shmmax = 68719476736

Kernel.shmall = 4294967296

Net.ipv4.tcp_max_tw_buckets = 6000

Net.ipv4.tcp_sack = 1

Net.ipv4.tcp_window_scaling = 1

Net.ipv4.tcp_wmem = 8192 4336600 873200

Net.ipv4.tcp_rmem = 32768 4336600 873200

Net.core.wmem_default = 8388608

Net.core.rmem_default = 8388608

Net.core.rmem_max = 16777216

Net.core.wmem_max = 16777216

Net.core.netdev_max_backlog = 262144

Net.core.somaxconn = 262144

Net.ipv4.tcp_max_orphans = 3276800

Net.ipv4.tcp_max_syn_backlog = 262144

Net.ipv4.tcp_timestamps = 1

Net.ipv4.tcp_synack_retries = 1

Net.ipv4.tcp_syn_retries = 1

Net.ipv4.tcp_tw_recycle = 1

Net.ipv4.tcp_tw_reuse = 1

Net.ipv4.tcp_mem = 786432 1048576 1572864

Net.ipv4.tcp_fin_timeout = 30

# net.ipv4.tcp_keepalive_time = 30

Net.ipv4.tcp_keepalive_time = 300

Net.ipv4.ip_local_port_range = 1024 65000

Use sysctl-p to make it work. Students who need it can try it.

This is the end of "how to configure optimized sysctl.conf". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Configuration yes content parameters more knowledge website practicality achievement next code classmate dilemma reality situation article case system editing industry Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Shulou Information NVidia Xiaomi vpn