Linux operating system practice optimization Kernel Parameter Optimization (instance), linux Kernel

Source: Internet
Author: User

Linux operating system practice optimization Kernel Parameter Optimization (instance), linux Kernel

Abstract: Linux Server Kernel Parameter Optimization high concurrency linux production server Kernel Parameter Optimization Case Study: This optimization is suitable for apache, nginx, squid and other web applications, special services may need to be slightly adjusted. The so-called kernel optimization is mainly the System Kernel Parameter Optimization for business service applications in Linux systems. There is no special standard for the optimization, the following describes the linux kernel Optimization in a common production environment for your reference. conf Add the following kernel parameters to the end of the configuration file [aliyunzixun@xxx.comscripts] # vi/etc/

Linux Server Kernel Parameter Optimization

Case study of Kernel Parameter Optimization for High-concurrency linux production servers

Note: This optimization is suitable for apache, nginx, squid, and other web applications. Special Services may need to be slightly adjusted.

The so-called kernel optimization is mainly the System Kernel Parameter Optimization for business service applications in Linux systems. There is no special standard for the optimization, the following describes how to optimize the kernel of linux in a common production environment for your reference:

Open/etc/sysctl. conf and add the following kernel parameters to the end of the configuration file.

[Aliyunzixun@xxx.comscripts] # vi/etc/sysctl. conf

Net. ipv4.tcp _ fin_timeout = 2

Net. ipv4.tcp _ tw_reuse = 1

Net. ipv4.tcp _ tw_recycle = 1

Net. ipv4.tcp _ syncookies = 1

Net. ipv4.tcp _ keepalive_time = 600

Net. ipv4.ip _ local_port_range = 4000 65000

Net. ipv4.tcp _ max_syn_backlog = 16384

Net. ipv4.tcp _ max_tw_buckets = 36000

Net. Route 4.route. gc_timeout = 100

Net. ipv4.tcp _ syn_retries = 1

Net. ipv4.tcp _ synack_retries = 1

Net. core. somaxconn = 16384

Net. core. netdev_max_backlog = 16384

Net. ipv4.tcp _ max_orphans = 16384

# The following parameters are used to optimize the iptables firewall. If the firewall does not have a meeting prompt, ignore it.

Net. ipv4.ip _ conntrack_max = 25000000

Net. ipv4.netfilter. ip_conntrack_max = 25000000

Net. ipv4.netfilter. ip_conntrack_tcp_timeout_established = 180

Net. ipv4.netfilter. ip_conntrack_tcp_timeout_time_wait = 120

Net. ipv4.netfilter. ip_conntrack_tcp_timeout_close_wait = 60

Net. ipv4.netfilter. ip_conntrack_tcp_timeout_fin_wait = 120

[Aliyunzixun@xxx.comscripts] # sysctl-p

Reload Kernel Parameters

The above is an explanation of Kernel Parameter Optimization for linux operating system practice optimization. For more information about Kernel optimization, see the Linux operating system practice parameter search function in the upper-right corner.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.