Performance tuning for web servers
|
Separating Static and Dynamic Content
When individual Apache processes need a lot of RAM, such as for a complex PHP application, then it may be a good idea to have separate processes deliver the static content. It is easier when a separate Apache server with a lean configuration and minimal memory footprint takes over this task. This can then be made into a front end server that directs the PHP requests on to an additional Apache web server via mod_proxy .
Alternatively, it is possible to use your own sub-domains for static content (e.g., static.ubuntu-user.com ) or its own domain, as with i.ytimg.com for YouTube.
Monitoring
The mod_status module lets you request information about the activity and performance of the Apache server. The module is inactive by default. It can easily be activated under Debian or Ubuntu via
a2enmod status
The standard URL for accessing the server is /server-status . Typically, you will have to explicitly set the access rights.
<Location /server-status> SetHandler server-status Require ip 192.0.2.0/24 </Location>
After restarting the web server, access to the status page should be available. Hopefully, this access is limited to the LAN. (See the "Access Is Too Easy" box.)
Access Is Too Easy
The server status page of the official Apache web server (Figure 4) is publicly accessible. If a private server can be accessed via the Internet, it is not a good idea to publish the page.
The status page is used for manual analysis, for example, when special load peaks need to be measured. At the same time, this page provides a basis for automatic monitoring that is carried out via something like a Nagios or Icinga plugin [7][8] or via the Percona Apache monitoring template for Cacti [9] (Figure 5). In this way, a web server administrator can systematically monitor the Apache web server and analyze the data.
Obviously, the use of mod_status creates a certain amount of overhead. In spite of the overhead, this is a fair trade off.
Buy this article as PDF
Pages: 6
(incl. VAT)