6 Managing and Monitoring Server Processes

You have tools and procedures that help to manage and monitor the performance of Oracle HTTP Server.

This chapter includes the following sections. These sections discuss the procedures and tools that manage the server in your environment.

Oracle HTTP Server Processing Model

There are two types of processing models that help to monitor Oracle HTTP Server: Request Process Model and Single Unit Process Model.

The following sections describe the processing models for Oracle HTTP Server.

Request Process Model

After Oracle HTTP Server is started, it is ready to listen for and respond to HTTP(S) requests. The request processing model on Microsoft Windows systems differs from that on UNIX systems.

  • On Microsoft Windows, there is a single parent process and a single child process. The child process creates threads that are responsible for handling client requests. The number of created threads is static and can be configured for performance.

  • On UNIX, there is a single parent process that manages multiple child processes. The child processes are responsible for handling requests. The parent process brings up additional child processes as necessary, based on configuration. Although the server can dynamically start additional child processes, it is best to configure the server to start enough child processes initially so that requests can be handled without having to spawn more child processes.

Single Unit Process Model

Oracle HTTP Server provides functionality that allows it to terminate as a single unit if the parent process fails. The parent process is responsible for starting and stopping all the child processes for an Oracle HTTP Server instance. The failure of the parent process without first shutting down the child processes leaves Oracle HTTP Server in an inconsistent state that can only be fixed by manually shutting down all the orphaned child processes. Until all the child processes are closed, a new Oracle HTTP Server instance cannot be started because the orphaned child processes still occupy the ports the new Oracle HTTP Server instance needs to access.

To prevent this from occurring, the DMS instrumentation layer in child processes on UNIX and monitor functionality within WinNT MPM on Windows monitor the parent process. If they detect that the parent process has failed, then all of the remaining child processes are shut down.

Monitoring Server Performance

Oracle Fusion Middleware automatically and continuously measures runtime performance for Oracle HTTP Server and Oracle WebLogic Server proxy plug-in module.

The server 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 hanging, you can view the metrics to find out more about the problem. Fusion Middleware Control provides real-time data. Cloud Control can be used to view historical data.

These sections describe performance metrics and how to view them:

Oracle HTTP Server Performance Metrics

This section lists commonly-used metrics that can help you analyze Oracle HTTP Server performance.

Oracle HTTP Server Metrics

The Oracle HTTP Server Metrics folder contains performance metric options for Oracle HTTP Server. The following table describes the metrics in the Oracle HTTP Server Metrics folder:

Element Description

CPU Usage

CPU usage and idle times

Memory Usage

Memory usage and free memory, in MB

Processes

Busy and idle process metrics

Request Throughput

Request throughput, as measured by requests per second

Request Processing Time

Request processing time, in seconds

Response Data Throughput

Response data throughput, in KB per second

Response Data Processed

Response data processed, in KB per response

Active HTTP Connections

Number of active HTTP connections

Connection Duration

Length of time for connections

HTTP Errors

Number of HTTP 4xx and 5xx errors

Oracle HTTP Server Virtual Host Metrics

The Oracle HTTP Server Virtual Host Metrics folder contains performance metric options for virtual hosts, also known as access points. The following table describes the metrics in the Oracle HTTP Server Virtual Host Metrics folder:

Element Description

Request Throughput for a Virtual Host

Number of requests per second for each virtual host

Request Processing Time for a Virtual Host

Time to process each request for each virtual host

Response Data Throughput for a Virtual Host

Amount of data being sent for each virtual host

Response Data Processed for a Virtual Host

Amount of data being processed for each virtual host

Oracle HTTP Server Module Metrics

The Oracle HTTP Server Module Metrics folder contains performance metric option for modules. The following table describes the metrics in the Oracle HTTP Server Module Metrics folder.

Element Description

Request Handling Throughput

Request handling throughput for a module, in requests per second

Request Handling Time

Request handling time for a module, in seconds

Module Metrics

Modules including active requests, throughput, and time for each module

Viewing Performance Metrics

You can view the performance metrics of the Oracle HTTP Server and Oracle WebLogic Server Proxy Plug-In module by using the Fusion Middleware Control or issuing the appropriate WLST command. View performance metrics to monitor and analyze the server performance.

You can view Oracle HTTP Server and Oracle WebLogic Server Proxy Plug-In module performance metrics by using the procedures described in the following sections:

Viewing Server Metrics by Using Fusion Middleware Control

You can view metrics from the Oracle HTTP Server home menu of Fusion Middleware Control:

  1. Select the Oracle HTTP Server that you want to monitor.
  2. From the Oracle HTTP Server menu on the Oracle HTTP Server home page, choose Monitoring, and then select Performance Summary.

    The Performance Summary page is displayed. It shows performance metrics and information about response time and request processing time for the Oracle HTTP Server instance.

  3. To see additional metrics, click Show Metric Palette and expand the metric categories.

    Tip:

    Oracle HTTP Server port usage information is also available from the Oracle HTTP Server home menu.

    The following figure shows the Oracle HTTP Server Performance Summary page with the Metric Palette displayed:

  4. Select additional metrics to add them to the Performance Summary.

Viewing Server Metrics Using WLST

To obtain and view metrics for an instance from the command line, you must connect to, and issue the appropriate WLST command. These commands allow you to perform any of these functions:

  • Display Metric Table Names

  • Display metric tables

  • Dump metrics

Note:

For more information on using WLST, see Understanding the WebLogic Scripting Tool.

Before attempting this procedure:

Before attempting to access server metrics from the command line, ensure the following:

  • The domain exists and the instance for which you want to see the metrics exist.

  • The instance is running.

  • Node Manager is running on the instance machine.

The Administration server can be running, but this is not required.

To view metrics using WLST:

Note:

In both managed and standalone domain types, the following procedure will work whether you run the commands from the same machine or from a machine that is remote to the server.

  1. Launch WLST:

    On Linux or UNIX:

    $ORACLE_HOME/oracle_common/common/bin/wlst.sh
    

    On Windows:

    $ORACLE_HOME\oracle_common\common\bin\wlst.cmd
    
  2. From the selected domain directory (for example, ORACLE_HOME/user_projects/domains/domainName), connect to the instance:
    nmConnect('username', 'password', nm_host, nm_port, domainName)
    
  3. Enter one of the following WLST commands, depending on what task you want to accomplish:
    • displayMetricTableNames(servers=['serverName'], servertype='serverType')

    • displayMetricTables(servers=['serverName'], servertype='serverType')

    • dumpMetrics(servers=['serverName'], servertype='serverType')

    For example:

    displayMetricTableNames(servers=['ohs1'], servertype='OHS') 
    displayMetricTables(servers=['ohs1'], servertype='OHS') 
    dumpMetrics(servers=['ohs1'], servertype='OHS') 

Oracle HTTP Server Performance Directives

Oracle HTTP Server performance is managed by directives specified in the configuration files. Use Fusion Middleware Control to tune performance-related directives for Oracle HTTP Server.

The following sections describe the Oracle HTTP Server performance directives.

Understanding Performance Directives

Oracle HTTP Server uses directives declared in httpd.conf and other configuration files. This configuration file specifies the maximum number of HTTP requests that can be processed simultaneously, logging details, and certain limits and timeouts. Oracle HTTP Server supports and ships with the following Multi-Processing Modules (MPMs) which are responsible for binding to network ports on the machine, accepting requests, and dispatching children to handle the requests:

  • Worker: This is the default MPM for Oracle HTTP Server in UNIX (non-Linux) environments. This MPM implements a hybrid multi-process multi-threaded server. By using threads to serve requests, it can serve many requests with fewer system resources than a process-based server. However, it retains much of the stability of a process-based server by keeping multiple processes available, each with many threads. If you are using Worker MPM, then you must configure the mod_cgid module for your CGI applications instead of the mod_cgi module. For more information, see the following URL:

    http://httpd.apache.org/docs/2.4/mod/mod_cgid.html

  • WinNT: This is the default MPM for Oracle HTTP Server on Windows platforms. It uses a single control process which launches a single child process which in turn creates threads to handle requests.

  • Prefork: This MPM implements a non-threaded, pre-forking server that handles requests in a manner similar to Apache 1.3. It is appropriate for sites that need to avoid threading for compatibility with non-thread-safe libraries. It is also the best MPM for isolating each request, so that a problem with a single request will not affect any other. If you are going to implement a CGI module with this MPM, use only mod_fastcgi.

  • Event: This is the default MPM for Oracle HTTP Server in Linux environments. This MPM is designed to allow more requests to be served simultaneously by passing off some processing work to supporting threads, freeing up the main threads to work on new requests. It is based on the Worker MPM, which implements a hybrid multi-process multi-threaded server. Run-time configuration directives are identical to those provided by Worker.

The following sections describe how to change the MPM type value for an Oracle HTTP Server instance in a standalone and an Oracle WebLogic Server domain

Changing the MPM Type Value in a Standalone Domain

To change the MPM type value for an Oracle HTTP Server instance in a standalone domain, follow these steps:

  1. Navigate to the ohs.plugins.nodemanager.properties file at the following location: ${ORACLE_INSTANCE}/config/fmwconfig/components/OHS/${COMPONENT_NAME}.
  2. Edit the ohs.plugins.nodemanager.properties file to make the following changes.

    Look for the key mpm in an uncommented line.

    • If you find the key in an uncommented line, then replace the existing value of mpm with the value you want to set for MPM.

    • If you do not find it in an uncommented line, then add a new line to the file using the following format:

      mpm = mpm_value
      

      where mpm_value is the value you want to set as MPM.

  3. Start or re-start the Oracle HTTP Server instance.

Changing the MPM Type Value in a WebLogic Server Managed Domain

To change the MPM type value for an Oracle HTTP Server instance in an Oracle WebLogic Server domain, follow these steps.

Note:

The following steps assume that the Administration Server and Node Manager for the domain are already up and running.

  1. Launch WLST from the command line.

    Linux or UNIX: $ORACLE_HOME/oracle_common/common/bin/wlst.sh

  2. Connect to the Administration Server instance:
    connect('<userName', '<password>', '<host>:<port>')
    
  3. Navigate to the Mbean containing the MPM type value key.

    You can use the editCustom() command only when WLST is connected to the Administration Server. Use cd to navigate the hierarchy of management objects. This example assumes that Oracle HTTP Server instance with name 'ohs1'.

    editCustom()
    cd('oracle.ohs')
    cd('oracle.ohs:type=OHSInstance.NMProp,OHSInstance=ohs1,component=OHS')
     
  4. Set the MPM type value key.

    Start an edit session and set the MPM type value key Mpm to the type value. In this example the type value is set to event.

    startEdit()
    set('Mpm','event') 
    save()
    activate()

Configuring Performance Directives by Using Fusion Middleware Control

The discussion and recommendations in this section are based on the use of Worker, Event, or WinNT MPM, which uses threads. The thread-related directives listed below are not applicable if you are using the Prefork MPM.

Use the Performance Directives page of Fusion Middleware Control, illustrated in the following figure, to tune performance-related directives for Oracle HTTP Server.

Performance directives management consists of these areas: request, connection, and process configuration. The following sections describe how to set these configurations.

Setting the Request Configuration by Using Fusion Middleware Control

To specify the Oracle HTTP Server request configuration using Fusion Middleware Control, do the following:

  1. Select Administration from the Oracle HTTP Server menu.
  2. Select Performance Directives from the Administration menu. The Performance Directives page appears.
  3. Enter the maximum number of requests in the Maximum Requests field (MaxRequestWorkers directive).

    This setting limits the number of requests that can be dealt with simultaneously. The default value is 400. This is applicable for all Linux/UNIX platforms.

  4. Set the maximum requests per child process in the Maximum Request per Child Process field (MaxConnectionsPerChild directive).

    You can choose to have no limit, or a maximum number. If you choose to have a limit, enter the maximum number in the field.

  5. Enter the request timeout value in the Request Timeout (seconds) field (Timeout directive).

    This value sets the maximum time, in seconds, Oracle HTTP Server waits to receive a GET request, the amount of time between receipt of TCP packets on a POST or PUT request, and the amount of time between ACKs on transmissions of TCP packets in responses.

  6. Review the settings. If the settings are correct, click Apply to apply the changes. If the settings are incorrect, or you decide to not apply the changes, click Revert to return to the original settings.
  7. Restart Oracle HTTP Server. See Restarting Oracle HTTP Server Instances.

The request configuration settings are saved, and shown on the Performance Directives page.

Setting the Connection Configuration by Using Fusion Middleware Control

To specify the connection configuration using Fusion Middleware Control, do the following:

  1. Select Administration from the Oracle HTTP Server menu.
  2. Select Performance Directives from the Administration menu. The Performance Directives page appears.
  3. Enter the maximum connection queue length in the Maximum Connection Queue Length field (ListenBacklog directive).

    This is the queue for pending connections. This is useful if the server is experiencing a TCP SYN overload, which causes numerous new connections to open up, but without completing the pending task.

  4. Set the Multiple Requests per Connection field (KeepAlive directive) to indicate whether to allow multiple connections. If you choose to allow multiple connections, enter the number of seconds for timeout in the Allow With Connection Timeout field.

    The Allow With Connection Timeout value sets the number of seconds the server waits for a subsequent request before closing the connection. Once a request has been received, the specified value applies. The default is 5 seconds.

  5. Review the settings. If the settings are correct, click Apply to apply the changes. If the settings are incorrect, or you decide to not apply the changes, click Revert to return to the original settings.
  6. Restart Oracle HTTP Server. See Restarting Oracle HTTP Server Instances.

The connection configuration settings are saved, and shown on the Performance Directives page.

Setting the Process Configuration by Using Fusion Middleware Control

The child process and configuration settings impact the ability of the server to process requests. You might need to modify the settings as the number of requests increase or decrease to maintain a well-performing server.

For UNIX, the default number of child server processes is 3. For Microsoft Windows, the default number of threads to handle requests is 150.

To specify the process configuration using Fusion Middleware Control, do the following:

  1. Select Administration from the Oracle HTTP Server menu.
  2. Select Performance Directives from the Administration menu. The Performance Directives page appears.
  3. Enter the number for the initial child server processes in the Initial Child Server Processes field (StartServers directive).

    This is the number of child server processes created when Oracle HTTP Server is started. The default is 3. This is for UNIX only.

  4. Enter the number for the maximum idle threads in the Maximum Idle Threads field (MaxSpareThreads directive).

    An idle thread is a process that is running, but not handling a request.

  5. Enter the number for the minimum idle threads in the Minimum Idle Threads field (MinSpareThreads directive).
  6. Enter the number for the threads per child server process in the Threads per Child Server Process field (ThreadsPerChild directive).
  7. Review the settings. If the settings are correct, click Apply to apply the changes. If the settings are incorrect, or you decide to not apply the changes, click Revert to return to the original settings.
  8. Restart Oracle HTTP Server. See Restarting Oracle HTTP Server Instances.

The process configuration settings are saved, and shown on the Performance Directives page.

Understanding Process Security for UNIX

Special configuration is required to allow Oracle HTTP Server to bind to privileged ports when installed on UNIX.

By default, Oracle HTTP Server is not able to bind to ports on UNIX in the reserved range (typically less than 1024). To enable Oracle HTTP Server to listen on ports in the reserved range (for example, port 80 and port 443) on UNIX, see Starting Oracle HTTP Server Instances on a Privileged Port (UNIX Only).