Kernel Optimization Measures for LAMP system performance optimization

Source: Internet
Author: User
Article Title: Kernel Optimization for LAMP system optimization. Linux is a technology channel of the IT lab in China. Including desktop applications, Linux system management, kernel research, embedded systems, open-source, and some other basic classification LAMP quick Kernel Tuning measures
Most Linux releases define appropriate buffers and other Transmission Control Protocol (TCP) parameters. You can modify these parameters to allocate more memory to improve network performance. The kernel parameter is set through the proc interface, that is, through the read/write/proc value. Fortunately, sysctl can read the values in/etc/sysctl. conf and fill in/proc as needed to manage these parameters more easily. Listing 2 shows some radical network settings applied to Internet servers on Internet servers.
Add these settings to the existing content of/etc/sysctl. conf. The first setting enables tcp syn cookie. When a new TCP connection is sent from the client, the server creates an entry for the semi-open connection and responds with a SYN-ACK packet. In normal operation, the remote client uses an ACK packet to respond. This will convert the half-open connection to full-open. There is a network attack called SYN flood (SYN flood), which makes ACK packets unable to be returned, resulting in the server using up memory space and unable to process incoming connections. The SYN cookie feature identifies this situation and uses an elegant method to reserve space in the queue (for details, see references ). Most systems enable this feature by default, but ensure that this feature is more reliable.
Enabling TCP Window Scaling enables the client to download data at a higher speed. TCP allows sending multiple data packets without receiving confirmation from the remote end. The default setting is a maximum of 64 KB. This setting may not be sufficient for communication with remote clients with a large latency. Window Scaling enables more bits in the header to increase the window size.
The TCP sending and receiving buffers are added in the following four configuration items. This allows the application to lose its data faster and serve another request. It can also enhance the ability of remote clients to send data when the server is busy.
The last configuration item adds the number of available local ports, which increases the maximum number of connections that can be simultaneously served.
These settings take effect the next time you boot the system or the next time you run sysctl-p/etc/sysctl. conf.
Through the description and code analysis in the article, we can use kernel optimization measures to optimize LAMP!
Related Article

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.