so-called Linux Optimization of server kernel parameters ( fit Apache,Nginx,Squid And so on web application , Special business may need to be adjusted slightly ), It mainly refers to Linux System kernel parameter adjustment for business service application , There is no standard for optimization . Here is the production environment Linux Common kernel optimization is illustrated by an example , For your reference .

      The method of optimization is execution vim /etc/sysctl.conf Command to end of file , Then copy the following and save it .

net.ipv4.tcp_fin_timeout = 2

net.ipv4.tcp_tw_reuse = 1

net.ivp4.tcp_tw_recycle = 1

net.ivp4.tcp_syncookies = 1

net.ivp4.tcp_keepalive_time = 600

net.ivp4.ip_local_port_range = 4000      65000

net.ivp4.tcp_max_syn_backlog = 16384

net.ipv4.tcp_max_tw_buckets = 36000

net.ivp4.route.gc_timeout = 100

net.ivp4.tcp_syn_retries = 1

net.ivp4.tcp_synack_retries = 1

net.core.somaxconn = 16384

net.core.netdev_max_backlog = 16384

net.ivp4.tcp_max_orphans = 16384

# The following parameters are correct iptables Optimization of firewall , Firewall does not hold a meeting prompt , It can be ignored

net.nf_conntrack_max = 25000000

net.netfilter.nf_conntrack_tcp_timeout_established = 180

net.netfilter.nf_conntrack_tcp_timeout_time_wait = 120

net.netfilter.nf_conntrack_tcp_timeout_close_wait = 60

net.netfilter.nf_conntrack_tcp_timeout_fin_wait = 120

Add the above kernel parameters to the /etc/sysctl.conf In the file , Then execute the following order to make it effective :

     
If it is in Centos6 In the environment , Must be turned on iptables The service will not show the above error , In fact, you can ignore it for the time being , At this time, the optimization of firewall , At this time, the firewall is not turned on , There will be no problem in the future .

      sysctl.conf The meaning of parameters in the kernel file is shown in the table 1 .

surface 1:

Technology
©2019-2020 Toolsou All rights reserved,
It's unexpected Python Cherry tree (turtle The gorgeous style of Library ) Some East 14 Pay change 16 salary , Sincerity or routine ? Browser kernel ( understand )java Four functional interfaces ( a key , simple )HashMap Explain in detail html Writing about cherry trees , Writing about cherry trees os Simple use of module