Skip Headers

Oracle® Application Server 10g Best Practices
10g (9.0.4)
Part No. B12223-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous Next  

6 Oracle HTTP Server

This chapter describes best practices for Oracle HTTP Server. It includes the following topics:

6.1 Configure Appropriately For Modem Connections

Some 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:

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. Refer to the Oracle Application Server 10g Performance Guide.

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. Tune this directive according to the KeepAlive parameters.

6.5 Avoid any DNS Lookup

Any DNS lookup can affect Oracle HTTP Server 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).

Performance degrades by a minimum of approximately 3% in 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 Logging

It is 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 do not 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 SymLinkIfOwnerMatch

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.

6.9 Use mod_rewrite to Hide URL Changes for End Users

Oracle HTTP Server includes a component, mod_rewrite, that can transparently map the URLs visible to the end users to a different URL. This is accomplished without a round-trip via the Web browser, or any code change.

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

6.10 Sticky Routing at Load Balancer is not Required

mod_oc4j is able to perform sticky routing independent of any external router or OracleAS Web Cache. Thus, for J2EE requests, the external router need not be set to perform sticky routing. However, if there are other requests (non-J2EE) in the mix that require sticky routing, then the sticky routing setup has to be performed on the external load balancer.