Apache performance prompt

Source: Internet
Author: User
Article title: Apache performance prompt. 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.
Apache is a universal Web server that puts correctness first and speed second. Even so, its performance is very satisfactory.
Many sites only have less than 10 m outbound bandwidth. Apache can work at full speed on the low-end Pentium servers of these sites. Actually,
Websites with more bandwidth need to use more than one machine to meet the requirements of
Width requirement. These causes lead to previous Apache development efforts focusing on correctness and configurability.
  
Unfortunately, many people place too much emphasis on some metrics and regard their raw data as a standard for evaluating the advantages and disadvantages of Web servers. Widely accepted
The standard is "bare minimum performance", while other speed indicators only apply
A small part of the market demand. However, we have made considerable efforts in Apache1.3 to prevent Apache from being squeezed out in some markets,
Minimize the gap between it and high-end servers.
  
Others just want to try these things to run faster. These people try to squeeze out the last drop of Apache performance. They also want to see
Check what affects Apache performance. The rest of this article is for them.
  
Note that this article applies to Apache1.3 on Unix, and some content applies to the NT platform. Currently, Apache has not been optimized on NT.
In fact, different programming models make it very poor in NT Performance. (POSIX model. NT uses POSIX subsystem simulation
This programming standard is therefore inefficient. Apache2.0 discards POSIX and directly deals with the operating system,
Performance will be improved)
  
About the hardware platform and operating system
The most direct impact on Web server performance is the number of hardware RAM. A Web server should never access the memory swap zone. Added each exchange
The latency of the request ". They will click [stop] and reload the webpage, which will further increase the server
. It is also necessary for you to adjust MaxClients so that your server will not derive too many sub-processes, resulting in exchange.
  
Other things are not that critical. With a fast CPU, fast Nic, and hard disk, you can make your server "fast enough ".
In fact, this word is fast enough to be understood by experience.
  
The selection of operating systems is also a big problem worth consideration. The general principle is to get the latest TCP/IP patch from the operating system provider in a timely manner.
The rapidly emerging HTTP service broke many assumptions set in the Unix kernel as of 1994 or even 95 years. Ideal options include
Currently, FreeBSD and Linux are supported.
  
Run-Time Configuration)
HostnameLookups
In Apache versions earlier than 1.3, the default value of HostnameLookups is On, which causes the server to perform NDS queries each time a request is sent,
This increases latency. Apache1.3 sets this default value to Off. In versions 1.3 and later, if you use any
Allow from domain or deny from domain command, the cost will be the delay caused by two DNS queries (in a reverse
After the query, follow a forward query to ensure that the results obtained by the former are true ). Therefore, to achieve the best performance, avoid using
HostnameLookups (using IP addresses instead of domain names is also a good idea ).
  
It is feasible to limit the scope of use of commands, such as using similar containers. In this case, DNS queries
The query only occurs in requests that meet the conditions. The following example only takes place in the request of the .html and. cgi files:
  
HostnameLookups off
  

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.