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.