Error logging Oracle HTTP Server Logging Options

Oracle HTTP Server Performance Tuning 5-11

5.5.1 Analyze Static Versus Dynamic Requests

It is important to understand where your server is spending resources so you can focus your tuning efforts in the areas where the most stands to be gained. In configuring your system, it can be useful to know what percentage of the incoming requests are static and what percentage are dynamic. Generally, you want to concentrate your tuning effort on dynamic pages because dynamic pages can be costly to generate. Also, by monitoring and tuning your application, you may find that much of the dynamically generated content, such as catalog data, can be cached, sparing significant resource usage.

5.5.2 Beware of a Single Data Point Yielding Misleading Results

You can get unrepresentative results when data outliers appear. This can sometimes occur at start-up. To simulate a simple example, assume that you ran a PLSQL Hello, World application for about 30 seconds. Examining the results, you can see that the work was all done in mod_plsql.c: ohs_serverohs_modulemod_plsql.c handle.maxTime: 859330 handle.minTime: 17099 handle.avg: 19531 handle.active: 0 handle.time: 24023499 handle.completed: 1230 Note that handle.maxTime is much higher than handle.avg for this module. This is probably because when the first request is received, a database connection must be opened. Later requests can make use of the established connection. In this case, to obtain a better estimate of the average service time for a PLSQL module, that does not include the database connection open time which causes the handle.maxTime to be very large, recalculate the average as in the following: time - maxTimecompleted -1 For example: 24023499 - 8593301230 - 1 = 18847.98

5.5.3 Beware of Having More Modules

Oracle HTTP Server, which is now based on Apache 2.2, has a slight change in architecture in the way the requests are handled, compared to the previous release of Oracle HTTP Server, which was based on Apache 1.3. In the new architecture, Oracle HTTP Server invokes the service function of each module that is loaded in the order of definition in httpd.conf file until the request is serviced. This indicates that there is some cost associated with invoking the service function of each module, to know if the service is accepted or declined. Because of this change in architecture, consider placing the most frequently hit modules above the others in the httpd.conf file. Finally, for the static page requests, which are directly deployed to Oracle HTTP Server and served by the default handler, the request has to go through all the modules before the default handler is invoked. This process can impact performance of the request so consider enabling only the modules that are required by the deployed application. Example, if mod_plsql is never used by the deployed application, disable it to maintain performance. 5-12 Oracle Fusion Middleware Performance and Tuning Guide In addition, there are a few modules that register their hooks to do some work during the URL translation phase, which would add to the cost of request processing time. Example: mod_security, when enabled, has a cost of about 10 on CPU Cost per Transaction for the specweb benchmark. Again, you should enable only those modules that are required by your deployed applications to save CPU time.

5.5.4 Monitoring Oracle HTTP Server

Oracle Fusion Middleware automatically and continuously measures run-time performance for Oracle HTTP Server. The performance metrics are automatically enabled; you do not need to set options or perform any extra configuration to collect them. If you encounter a problem, such as an application that is running slowly or is hanging, you can view particular metrics to find out more information about the problem. In addition to the Fusion Middleware Control, Oracle HTTP Server also has Dynamic Monitoring Service DMS, which collects metrics for every functional piece. You can review these metrics as needed to understand system behavior at a given point of time. This displays memory, CPU information and the min, max, average times for the request processing at every layer in Oracle HTTP Server. The metrics also display details about load level, number of threads, number of active connections, and so on, which can help in tuning the system based on real usage. You can use Oracle Enterprise Manager or SpyServlet to monitor the metrics. See Chapter 4, Monitoring Oracle Fusion Middleware . Another way to view DMS metrics for OHS is shown in the following example: 1. cd INSTANCE_HOMEbin 2. .opmnctl metric op=query COMPONENT_NAME=component_name dmsarg=[name=OHSModulesmodule_name.c Examples: .opmnctl metric op=query COMPONENT_NAME=ohs1 dmsarg=[name=OHSModulesmod_cgi.c .opmnctl metric op=query COMPONENT_NAME=ohs1 dmsarg=[name=] Note: Fusion Middleware Control provides real-time data. For more information on using Fusion Middleware Control to view performance metrics for HTTP Server, see Monitoring Oracle HTTP Server Performance in Oracle Fusion Middleware Administrators Guide for Oracle HTTP Server. If you are interested in viewing historical data, consider using Grid Control. See Section 4.8, Oracle Enterprise Manager 11g Grid Control .