LAMP system optimization (1)

Source: Internet
Author: User

LAMPSystemOptimizationIt is very necessary. A good optimization can make the system operate faster and improve work efficiency. I will introduce the content of LAMP system optimization in detail from several aspects.

 

LAMP

I. hardware optimization

1. General hardware upgrade rules: For PHP scripts, the main bottleneck is CPU, and for static pages, the bottleneck is memory and network. The Static Page downloaded by a 400 Mhz ordinary Pentium machine can make the T3 leased line (45 Mbps) saturated.

2. hdparm is used to optimize disks. Generally, the read/write performance of the IDE disk is improved by 200%, but it also has an effect on the SCSI hard disk. (Comparison of hard disks of different types)

Policy Optimization

3. Apache processes PHP scripts 2-10 times slower than static pages, so try to use more static pages and fewer scripts.

4. If PHP scripts are not buffered, compilation is required for each call. Therefore, installing a PHP buffer product can improve the performance by 25-100%.

5. If you use a Linux system, we recommend that you upgrade the kernel to 2.4 because the static page is served by the kernel.

6. Another Buffer technology is to use HTML buffer output for infrequently modified PHP pages.

7. Do not run X-Windows on the Web server, and disable unnecessary processes.

8. If you can use text, do not use images. Minimize the image size.

9. Distribute the load and put the database server on another machine. If all static pages are processed on another server, you can set KeepAlives in httpd. conf to off to reduce the disconnection time.

10. All the above methods are for standalone servers. If you think the system is not fast enough, you can use the cluster, Server Load balancer, and buffering technologies. Use Squid as the buffer and configure Squid.


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.