Apache performance optimization skills

Source: Internet
Author: User
Article Title: Apache performance optimization tips. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
This article briefly introduces several tips for optimizing Apache, which are very useful in practice.
  
Upgrade Apache to the latest version. The new version usually includes performance improvement and security updates.
  
Setting "HostNameLookups off" in httpd. conf can avoid reverse queries for the DNS domain name of each visitor.
  
For busy websites, set "MaxClients 230" or higher in httpd. conf. This setting allows more httpd processes to respond to requests at the same time, and avoids processor queuing.
  
Use another server to process image files.
  
The browser Buffer technology is used to protect your Web pages and CGI pages. For specific articles, refer to this site: Using mod_gzip to accelerate Zope and Apache
  
Keep your Apache slim and compile only required modules. Before compilation, modify the src/Configuration file and comment out unnecessary modules with the # code.
  
If no traffic log is required, point the TransferLog in httpd. conf to/dev/null/
  
Unless you are sure to use the. htaccess file to control the permissions of some directories, you can set "AllowOverride None" to avoid the hard work of Apache in searching for. htaccess files in each directory.
  
Do not run unwanted background processes.
  
Do not write pages or log files to network disks, such as NFS.
  
Do not run Apache (httpd) in inetd mode.
  
Do not run X Windows on your Web server. use Ctrl-Alt-Backspace to disable X.
  
Avoid using SSI tags.
  
In the CGI script:
File I/O: the smaller the number of opened files, the better.
Shell Command: use the full path to call the shell command.
If your website is mainly driven by CGI, use mod_perl.
In your Web page Directory, do not set the number of files to more than 1000. The more files, the more time they spend locating them.
  
The smaller the number of images on the Web server, the better. Ensure that each image runs through the image compression tool.
  
We recommend that you use the AB command that comes with Apache to test the stress on your website.
  
For the best performance, it is best to unplug the network cable, so that your Web server is very safe, and the load is immediately reduced to 0 ,:-)
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.