Oracle® Application Server 10g Performance Guide
10g (9.0.4) Part No. B10379-01 |
|
![]() |
![]() |
This chapter discusses how to monitor the performance of Oracle Application Server and its components. Monitoring Oracle Application Server and obtaining performance data can assist you in tuning the system and debugging applications with performance problems.
This chapter contains the following topics:
This section describes how to use the Oracle Application Server tools for performance monitoring. You can monitor the server and its components using one or more of the following:
Oracle Enterprise Manager Application Server Control (Application Server Control) allows you to monitor Oracle Application Server and its components. Application Server Control shows performance metrics for Oracle Application Server components, including:
Oracle HTTP Server (OHS)
Oracle Application Server Containers for J2EE (OC4J) and Applications running under OC4J
Oracle Application Server Web Cache
Oracle Application Server Portal (OracleAS Portal)
Oracle Application Server automatically measures runtime performance and collects metrics for the Oracle HTTP Server, including child servers, and Oracle Application Server Containers for J2EE (OC4J) servers. The server performance metrics are measured automatically and continuously using performance instrumentation inserted into the implementations of Oracle Application Server components. The performance metrics are automatically enabled; you do not need to set options or perform any extra configuration to collect them (for performance reasons the JDBC metrics are enabled by setting options).
The Oracle HTTP Server performance metrics enable you to do the following:
Monitor the duration of important phases of Oracle HTTP Server request processing.
Collect status information on Oracle HTTP Server requests. For example, you can monitor the number of requests being handled at any given moment.
The OC4J performance metrics allow you to monitor the performance of J2EE containers and enable you to do the following:
Monitor the number of active servlets, JSPs, EJBs, and EJB methods.
Monitor the time spent processing an individual servlet, JSP, EJB, or EJB method.
Monitor the sessions and JDBC connections associated with servlets, JSPs, EJBs, or EJB methods.
Monitor OC4J JMS events and status.
You can use the performance metrics while troubleshooting Oracle Application Server components to help locate bottlenecks, identify resource availability issues, or help tune your components to improve throughput and response times.
Note: You can use the commands that access the built-in metrics in scripts or in combination with other monitoring tools to gather performance data or to check application performance. |
In order to solve performance problems or to monitor your system’s activity, you can use the available native operating system commands. Native operating system commands allow you to gather and monitor CPU utilization, paging activity, swapping, and other system activity information.
See Also: Refer to the system level documentation for information on native operating system monitoring commands. |
You can use network monitoring tools to verify the status of requests that access your Oracle Application Server components. Tools are available that allow you to examine and save network traffic information. These tools can be helpful in analyzing and solving performance problems.
You can monitor performance using Application Server Control or by viewing the Oracle Application Server built-in performance metrics.
This section describes how to view the built-in performance metrics using the AggreSpy
servlet, the Spy
servlet, or using the dmstool
command.
This section covers the following:
Table 2-1 summarizes the tools that allow you to view built-in performance metrics.
Table 2-1 Oracle Application Server Built-in Monitoring Commands
Command | Description |
---|---|
AggreSpy
|
AggreSpy is a pre-packaged servlet that reports performance metrics for an Oracle Application Server instance. You can only run AggreSpy when an OC4J instance is configured to support it. By default the OC4J instance named home supports AggreSpy .
|
dmstool
|
Allows you to monitor a specific performance metric, a set of performance metrics, or all performance metrics. Options allow you to specify a reporting interval to report the requested metrics. This command also allows you to show a text report listing all the built-in performance metrics available on the site. dmstool is located in the $ORACLE_HOME/bin directory.
|
Spy
|
Spy is a pre-packaged servlet that reports performance metrics for OC4J standalone. Spy reports performance data for an OC4J process.
|
The AggreSpy
Servlet displays metrics for Oracle Application Server processes, including Oracle HTTP Server, OC4J, Oracle Process Manager and Notification Server, and other Oracle Application Server component processes.
This section covers the following topics:
AggreSpy
organizes metrics into two areas: DMS Spies and Metric Tables.
DMS Spies show the available metrics by parent process type and parent process number. By selecting individual DMS Spies, you can view, in text form, all metrics collected for the associated process.
Metric Tables show the available metrics by metric table type and when multiple OC4Js are running include OC4J metrics from multiple OC4J instances. By selecting individual metric tables you can view, in table form, all metrics of a specified type. For example, metric tables allow you to view the metrics associated with OC4J Servlets, Oracle HTTP Server Modules, and Oracle Process Manager and Notification Server processes.
Note: To view DMS metrics usingAggreSpy , you may need to configure your browser to disable the use of a proxy for the localhost, if your system is configured to use proxies. By default Oracle Application Server only allows access for the localhost. See "AggreSpy URL With a Proxy Server" for details.
|
DMS metric tables are identified by a name, such as ohs_server
for the Oracle HTTP Server metrics. In AggreSpy
, the term Metric Tables refers to the built-in performance metric table names.
You can access performance metrics using AggreSpy
from the following URL:
http://host:port
/dms0/AggreSpy
where:
host is the Oracle HTTP Server host, for example, tv.us.oracle.com
.
port is the Oracle HTTP Server listener port, for example 7778
.
Note: You can only runAggreSpy when an OC4J instance is configured to support it, and the instance is running. By default, the OC4J instance named home supports AggreSpy .
|
Figure 2-1 shows a sample AggreSpy
display. The display shows two frames, one containing a list of DMS Spies and DMS Metric Tables, and one showing selected values for the DMS Spies or the Metric Tables.
AggreSpy
provides navigation and display options, including:
Access DMS Spies and Metric Tables using the links in the left frame.
Sort rows in metric tables by clicking on the column headings.
Display a table containing the descriptions of a Metric Table’s metrics by clicking the Metric Definitions link shown on each metric table.
You need to refresh your browser to display built-in metric data after you start AggreSpy
. When you first use AggreSpy
many of the fields, and the complete list of DMS Spies and may not contain all of the current Metric Tables. If you wait a short time, and then refresh the display, the data is available and AggreSpy
shows the complete list of Metric Tables.
If your browser is configured to use a proxy server, then to access AggreSpy
on the localhost, you need to configure the browser to disable the use of proxies for the localhost. The exact steps required to disable the use of a proxy server for the localhost depends on the browser you use.
By default, the dms0/AggreSpy
URL is redirected and the redirect location is protected, allowing only the localhost (127.0.0.1) to access the AggreSpy
Servlet.
To view metrics from a system other than the localhost you need to change the DMS configuration for the system that is running the Oracle Application Server that you want to monitor by modifying the file $ORACLE_HOME/Apache/Apache/conf/dms.conf
on UNIX, or %ORACLE_HOME\Apache\Apache\conf\dms.conf
on Windows systems. Example 2-1 shows a sample default configuration from dms.conf
. This configuration limits AggreSpy
to only access metrics on the localhost (127.0.0.1) . The port shown, 7200, may differ on your installation.
Example 2-1 dms.conf Sample for localhost Access for DMS Metrics
# proxy to DMS AggreSpy Redirect /dms0/AggreSpy http://localhost:7200/dmsoc4j/AggreSpy #DMS VirtualHost for access and logging control Listen 127.0.0.1:7200 OpmnHostPort http://localhost:7200 <VirtualHost 127.0.0.1:7200> ServerName 127.0.0.1
By changing the dms.conf
configuration to specify the host that provides, or serves DMS metrics, you can allow users on systems other than the localhost to access the DMS metrics from the location http://host:port/dms0/AggreSpy.
Example 2-2 shows a sample updated dms.conf
that allows access from a system other than the localhost (127.0.0.1) .
Note: Modifyingdms.conf has security implications. Only modify this file if you understand the security implications for your site. By exposing metrics to systems other than the localhost, you allow other sites to potentially view critical Oracle Application Server internal status and runtime information.
|
To view metrics from a system other than the localhost (127.0.0.1) , do the following:
Modify dms.conf
by changing the entries with the value "localhost" or "127.0.0.1" shown in Example 2-1 to the name of the server providing the metrics (obtain the server name from the ServerName
directive in the httpd.conf
file, for example tv.us.oracle.com
).
Restart, or stop and start the Oracle HTTP Server using Application Server Control or using the Oracle Process Manager and Notification Server opmnctl
command. For example,
%opmnctl restartproc process-type=HTTP_Server
or
%opmnctl stopproc process-type=HTTP_Server %opmnctl startproc process-type=HTTP_Server
Example 2-2 dms.conf Sample for Remote Host Access for DMS Metrics
# proxy to DMS AggreSpy Redirect /dms0/AggreSpy http://tv.us.oracle.com:7200/dmsoc4j/AggreSpy #DMS VirtualHost for access and logging control Listen tv.us.oracle.com:7200 OpmnHostPort http://tv.us.oracle.com:7200 <VirtualHost tv.us.oracle.com:7200> ServerName tv.us.oracle.com
See Also: Oracle Application Server 10g Security Guide for information on Oracle HTTP Server access control |
AggreSpy
does not work as expected when using Oracle Application Server Clusters. When using a cluster, the Oracle HTTP Server mod_oc4j
component load balances OC4J requests across Oracle Application Server instances. In this case, AggreSpy
may report results for systems that are not the localhost (127.0.0.1) .
Note: It is recommended, when using Oracle Application Server Clusters, that you usedmstool instead of AggreSpy .
|
The dmstool
command allows you to view a specific performance metric, a set of performance metrics, or all performance metrics for an Oracle Application Server instance. The dmstool
command also supports an option that allows you to set a reporting interval, specified in seconds, to report updated metrics every t seconds.
For example, you can monitor the performance of a specific servlet, JSP, EJB, EJB method, or database connection and you can request periodic snapshots of metrics specific to these components.
The format for using dmstool
to display built-in performance metrics is:
% dmstool [options] metric metric ...
or
% dmstool [options] –list
or
% dmstool [options] –dump
Table 2-2 lists the dmstool
command-line options
. Following Table 2-2 this section presents examples that show sample usage with specific performance metrics. The dmstool
command is located in the $ORACLE_HOME/bin
directory on UNIX or in %ORACLE_HOME%\bin
directory on Windows.
Note: You can usedmstool in scripts or in combination with other monitoring tools to gather performance data, to check application performance, or to build tools that modify your system based on the values of performance metrics.
|
See Also: "Using dmstool to List the Names of All Metrics" Appendix A, " Performance Metrics" for a list and description of the DMS metrics |
By default, dmstool
shows metrics only when it is run from the localhost (127.0.0.1) . If you want to view metrics from an Oracle Application Server running on a remote host, then you need to use dmstool
with the -a
option, on the local host, and update the dms.conf
file of the remote Oracle Application Server instance in the $ORACLE_HOME/Apache/Apache/conf/
directory on UNIX or %ORACLE_HOME%\Apache\Apache\conf\
directory on Windows.
The configuration changes required to control the access to metrics using dmstool
are the same as those for accessing dms0/AggreSpy
.
Table 2-2 dmstool Command-line Options
Option | Description |
---|---|
–a[ddress] opmn:// host [: port ]
|
By default, without the -a option, dmstool gets metrics from the Oracle Application Server instance with the same $ORACLE_HOME as dmstool . When dmstool runs in the same $ORACLE_HOME as the Oracle Process Manager and Notification Server, OPMN, the –a option is not required.
You can specify – Where:
For example, the following shows the specification in <notification-server> <port local="6100" remote="6200" request="6003"/> . . </notification-server> Note, if you use dmstool -a to request metrics from a remote system, the system must be configured to provide metrics (by default you can access DMS metrics on the localhost). See Also: "AggreSpy URL and Access Control" |
–c[ount] num
|
Specifies the number of times to retrieve values when monitoring metrics. If not specified, dmstool continues retrieving metric values until the process is stopped.
The – |
–dump [format=xml]
|
Using dmstool with the -dump option reports all the available metrics on the standard output. Oracle recommends that you run with the -dump option periodically, such as every 15 to 20 minutes, to capture and save a record of performance data for your Oracle Application Server server.
The -dump option also supports the |
–help
|
List the dmstool command-line options.
|
–i[nterval] secs
|
Specifies the number of seconds to wait between metric retrievals. The default is 5 seconds. The interval argument is not used with the –list option. The interval specified is approximate.
Note: if the system load is high, the actual interval may vary from the interval specified using the – |
–l[ist] [-table]
|
Generates a list of all metrics available. Use the –list option with the –table option to display a list of all the metric table names.
Note, including metric names on the command-line is not valid when using the – |
–table metric_table
|
Includes all the performance metrics for the specified metric table with the name, metric_table .
See Appendix A, " Performance Metrics" or run |
Every Oracle Application Server performance metric has a unique name. Using dmstool
with the –list
option produces a list of all metric names. The –list
output contains the metric names that you can use with dmstool
to request monitoring information for a specific metric or set of metrics.
Using the following command, dmstool
displays a list of all metrics available on the server:
% dmstool –list
This command displays a list of the available metrics.
To monitor a specific metric or set of metrics, use dmstool
and include the metric name on the command-line. For example, to monitor the time the JVM has been running, perform the following steps:
Use dmstool
with the -list
option to find the name of the metric that shows the JVM uptime:
% dmstool -list | grep JVM/upTime.value /system1/OC4J:3000:6004/JVM/upTime.value
Use dmstool
and supply the full metric name as an argument to show the metric value:
% dmstool /system1/OC4J:3000:6004/JVM/upTime.value Tue Apr 29 16:20:05 PDT 2003 /system1/OC4J:3000:6004/JVM/upTime.value 14022008 msecs
Using dmstool
, the default repeat interval is 10 seconds, so this command shows the updated metric value every 5 seconds. Use the -count
option to limit the number of times dmstool
reports values. For example:
% dmstool /system1/OC4J:3000:6004/JVM/upTime.value -count 2 Tue Apr 29 16:20:05 PDT 2003 /system1/OC4J:3000:6004/JVM/upTime.value 14336273 msecs Tue Apr 29 16:20:15 PDT 2003 /system1/OC4J:3000:6004/JVM/upTime.value 14345881 msecs
To monitor the load balance between the two identified OC4J processes for two hours, use the following dmstool
command, supplying several metric names on the command-line:
% dmstool -i 60 -c 120 \ /myhost/OC4J:3000:6003/oc4j/default/WEBs/default/processRequest.completed \ /myhost/OC4J:3000:6003/oc4j/default/WEBs/processRequest.completed \ /myhost/OC4J:3001:6003/oc4j/default/WEBs/default/processRequest.completed \ /myhost/OC4J:3001:6003/oc4j/default/WEBs/processRequest.completed \ /myhost/OC4J:3001:6003/oc4j/ojspdemos/WEBs/ojsp/JSPs/processRequest.completed \ /myhost/OC4J:3001:6003/oc4j/ojspdemos/WEBs/ojsp/processRequest.completed \ /myhost/OC4J:3001:6003/oc4j/ojspdemos/WEBs/processRequest.completed
This command reports 120 sets of output for the metrics listed on the command line, while collecting data at intervals of 60 seconds:
Mon Nov 19 17:13:01 PDT 2002
/myhost/OC4J:3000:6003/oc4j/default/WEBs/default/processRequest.completed 437 ops /myhost/OC4J:3000:6003/oc4j/default/WEBs/processRequest.completed 441 ops /myhost/OC4J:3001:6003/oc4j/default/WEBs/default/processRequest.completed 432 ops /myhost/OC4J:3001:6003/oc4j/default/WEBs/processRequest.completed 436 ops /myhost/OC4J:3001:6003/oc4j/ojspdemos/WEBs/ojspdemos/JSPs/processRequest.completed 452 ops /myhost/OC4J:3001:6003/oc4j/ojspdemos/WEBs/ojspdemos/processRequest.completed 425 ops /myhost/OC4J:3001:6003/oc4j/ojspdemos/WEBs/processRequest.completed 455 ops
Mon Nov 19 17:14:01 PDT 2002
/myhost/OC4J:3000:6003/oc4j/default/WEBs/default/processRequest.completed 452 ops /myhost/OC4J:3000:6003/oc4j/default/WEBs/processRequest.completed 470 ops /myhost/OC4J:3001:6003/oc4j/default/WEBs/default/processRequest.completed 462 ops /myhost/OC4J:3001:6003/oc4j/default/WEBs/processRequest.completed 451 ops /myhost/OC4J:3001:6003/oc4j/ojspdemos/WEBs/ojspdemos/JSPs/processRequest.completed 469 ops /myhost/OC4J:3001:6003/oc4j/ojspdemos/WEBs/ojspdemos/processRequest.completed 452 ops /myhost/OC4J:3001:6003/oc4j/ojspdemos/WEBs/processRequest.completed 472 ops
. . .
Using dmstool
with the -dump
option displays all the metrics from an Oracle Application Server instance to the standard output.
The following command displays all available metrics:
% dmstool –dump
Oracle recommends that you run dmstool
with the -dump
option periodically, such as every 15 to 20 minutes, to capture and save a record of performance data. If you save performance data over time, this data can assist you if you need to analyze system behavior to improve performance or when problems occur.
When you need to process metric data, use the format=xml
query on the dmstool
command line to report all metric values in XML format.
The following command displays all available metrics using XML format:
% dmstool –dump format=xml
Using dmstool
with the -a
option reports the metrics from a remote Oracle Application Server instance.
Note: By default the Oracle Application Server only allowsdmstool to access metrics from the localhost. You need to modify dms.conf to support access from systems other than the localhost. See "AggreSpy URL and Access Control" for information on DMS access control.
|
The following command displays all available metrics and metric values on the Oracle Application Server Instance, as specified with the –a
option:
% dmstool –a opmn://system1:6003 -list
Using the dmstool
-a option, supply an argument with the prefix opmn://
and include the host name where you want to obtain metrics, and the OPMN request port number. The port specifies the OPMN request port that supplies metrics for Oracle Application Server which is specified the request
attribute under the <notification-server>
element in $ORACLE_HOME/opmn/conf/opmn.xml
on UNIX and %ORACLE_HOME%\opmn\conf\opmn.xml
on Windows.
When you are using OC4J in standalone mode, without the Oracle Application Server, the Spy
Servlet allows you to access OC4J metrics in a manner similar to AggreSpy
.
When running OC4J standalone, access performance metrics using Spy
from the following URL:
http://myhost
:myport
/dmsoc4j/Spy
Note: You can only runSpy when OC4J is configured to support it, and OC4J is running. By default, OC4J supports Spy .
|
Table 2-3 covers the dmstool option that only applies to OC4J standalone mode. In addition, the options shown in Table 2-2 also apply to dmstool (except the -a option with the opmn://
prefix.
Table 2-3 dmstool Command-line Options (for Standalone OC4J only)
Option | Description |
---|---|
–a[ddress] host [: port ][path ],...
|
For a standalone OC4J system, use the -a option. This specifies the http:// protocol, where:
|