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:

©2019-2020 Toolsou All rights reserved,
AWS Elastic Compute Cloud (Amazon EC2) Study notes ControllerAdvice Common scenes of PTA-MOOC《Python Programming Zhejiang University 》 Puzzle A Chapter 2 programming problems Dart In Isolatejetson Nano debugging CSI Interface camera , Combined use opencv Turn on the camera Knowledge points of preparing for the Blue Bridge Cup find method Force button 496 The next bigger element IBert/Transformer Calculation of model parameters 2020 year Java industry , General analysis of market environment and position Lambda Expression and functional interface