Skip Headers

Oracle9i Application Server Best Practices
Release 2 (9.0.3)

Part Number B10578-02
Go To Documentation Library
Core
Go To Product List
Platform
Go To Table Of Contents
Contents

Go to previous page Go to next page

6
Oracle HTTP Server Best Practices

This chapter describes Oracle HTTP Server best practices. The topics include:

6.1 Configure Appropriately for Modem Connections

Most Web sites have visitors connecting from slow modems. Sometimes, it takes longer for data to transfer over these slow connections than for data to be computed by the application server. Thus, an Oracle HTTP Server process can be blocked doing the transfer, and CPU processing power is not available for another request to perform computation.

If this is perceived to be a problem in your environment, you should front-end Oracle HTTP Server with either (a) Oracle9iAS Web Cache, which has a threaded architecture, or, (b) Oracle HTTP Server in reverse proxy mode, which can spawn more light weight processes to handle the transfer. In both cases, the backend Oracle HTTP Server is reserved to do the computation work.

This separation of data computation and data transfer responsibilities buffers a site from latency due to slow modem connections.

6.2 Tune TCP/IP Parameters

Setting TCP/IP parameters can improve Oracle HTTP Server performance dramatically.

See the chapter titled "Optimizing Oracle HTTP Server" in the Oracle9i Application Server Performance Guide for a detailed explanation of each of these parameters.

6.3 Tune KeepAlive Directives

The KeepAlive, KeepAliveTimeout, and MaxKeepAliveRequests directives are used to control persistent connections. Persistent connections are supported in HTTP1.1 to allow a client to send multiple sequential requests through the same connection.

Setting KeepAlive to "On" allows Apache to keep the connection open for that client when the client requests it. This can improve performance, because the connection has to be set up only once. The trade-off is that the httpd server process cannot be used to service other requests until either the client disconnects, the connection times out (controlled by the KeepAliveTimeout directive), or the MaxKeepAliveRequests value has been reached.

You can change these KeepAlive parameters to meet your specific application needs, but you should not set the MaxKeepAliveRequests to 0. A value of 0 in this directive means there is no limit. The connection will be closed only when the client disconnects or times out.

You may also consider setting KeepAlive to "Off" if your application has a large population of clients who make infrequent requests.

6.4 Tune MaxClients Directive

The MaxClients directive controls the maximum number of clients who can connect to the server simultaneously. This value is set to 1024 by default.

If your requests have a short response time, you may be able to improve performance by setting MaxClients to a lower value. However, when this value is reached, no additional processes will be created, causing other requests to fail.

In general, increasing the value of MaxClients does not improve performance when the system is saturated.

If you are using persistent connections, you may require more concurrent httpd server processes, and you may need to set the MaxClients directive to a higher value. You should tune this directive according to the KeepAlive parameters.

6.5 Avoid Any DNS Lookup

Any DNS lookup can affect Apache performance. The HostNameLookups directive in Apache informs Apache whether it should log information based on the IP address (if the directive is set to "Off"), or look up the hostname associated with the IP address of each request in the DNS system on the Internet (if the directive is set to "On").

Oracle has found that performance degraded by a minimum of about 3% in our tests with HostNameLookups set to on. Depending on the server load and the network connectivity to your DNS server, the performance cost of the DNS lookup could be much higher. Unless you really need to have host names in your logs in real time, it is best to log IP addresses and resolve IP addresses to host names off-line.

6.6 Turn Off Access Login if You Do Not Need to Keep an Access Log

It is generally useful to have access logs for your Web server, both for load tracking and for the detection of security violations. However, if you find that you don't need these data, you should turn it off and reduce the overhead of writing the data to this log file.

6.7 Use FollowSymLinks and Not SymLinksIfOwnerMatch

The FollowSymLinks and SymLinksIfOwnerMatch options are used by Apache to determine if it should follow symbolic links. If the SymLinksIfOwnerMatch option is used, Apache will check the symbolic link and make sure the ownership is the same as that of the server.

6.8 Set AllowOverride to None

If the AllowOverride directive is not set to None, Apache will check for directives in the .htaccess files at each directory level until the requested resource is found for each URL request. This can be extremely expensive.

6.9 Use mod_rewrite to Hide URL Changes for End Users

Oracle9iAS includes a component that can transparently map the URLs visible to the end users to a different URL - without requiring a round-trip to the browser, or, any code change.

This feature makes it very easy to re-organize directories on the server side, or, other changes even after an application has been developed and deployed. There is a slight performance impact, however, as this configuration change for mod_rewrite is generally preferred over unfriendly URLs.


Go to previous page Go to next page
Oracle
Copyright © 2003 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Core
Go To Product List
Platform
Go To Table Of Contents
Contents