Oracle9i Application Server Oracle HTTP Server powered by Apache Performance Guide Release 1.0.2.2 for Sun SPARC Solaris Part Number A86676-02 |
|
This chapterdescribes utilities and processes you can use to gather performance information from your system. This information helps you to determine the best use of your resources.
This chapter contains the following sections:
In order to solve performance problems or tune your system, it is useful to know how the CPU is spending its time (for example, scheduling tasks or performing work). You can determine process utilization by gathering CPU statistics, or evaluate system scalability by adding users and increasing the system workload, then monitoring paging, swapping, and CPU utilization. Use utilities such as sar
(System Activity Reporter) and mpstat
to monitor process use.
You can use sar
to sample cumulative activity counters in the operating system at specified intervals.
To determine process use, use the sar
command. In the example below, the command options -u
, 3
and 10
tell sar to report CPU utilization in three second intervals ten times.
prompt>sar -u 3 10 SunOS jpond-sun 5.6 Generic_105181-19 sun4u 10/12/00 12:17:04 %usr %sys %wio %idle 12:17:07 1 0 0 99 12:17:10 0 2 0 97 12:17:13 3 0 0 96 12:17:16 20 6 1 72 12:17:19 15 14 0 71 12:17:22 6 5 0 89 12:17:25 1 0 0 99 12:17:28 16 13 6 65 12:17:31 1 2 1 96 12:17:34 0 1 0 99 Average 6 4 1 88
The statistics above show that the CPU was 88% idle for the given time interval. If your performance criteria specify that CPU usage must be below a certain percentage, then you can use sar
to sample usage at a chosen interval during peak load times.
The sar
command (-u option) provides the following statistics:
sar
utility
The mpstat
utility is similar to sar
in that its first argument is the polling interval time in seconds. The second argument to sarsar
is the number of iterations.
The mpstat
command:
$ mpstat 1 3
reports three processor statistics in one second intervals. For example:
$ mpstat 1 3 CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 1 0 0 268 64 148 11 0 0 0 33 3 5 0 92 0 5 0 0 250 49 157 13 0 1 0 357 2 0 0 98 0 0 0 0 247 47 134 8 0 0 0 326 0 0 0 100
The mpstat
utility reports the statistics per processor, as shown in Table 2-2.
mpstat
utility
You can use network monitoring tools, such as snoop
on Solaris or Network Monitor
on Windows NT, to verify the status of a request as it is being transmitted across the network.
Following are examples of how you can use the snoop
utility to examine network packets. Using snoop
in conjunction with netstat
provides a good picture of network activity.
You can use the snoop
command with arguments to specify how you want to capture and/or save network packets.
You can use different command options to view packets captured in a file. For example, the command below displays the contents of the Gods
file with timestamps relative to the first packet displayed.
prompt>snoop -i Gods -t r | more
Below is an example of using snoop
to diagnose a suspected problem related to the FIN_WAIT_2 state:
prompt>snoop -i Gods | grep FIN
The first column of the output contains the packet numbers; you can get detailed information about a packet by typing:
prompt>snoop -i Gods -v -p<packet number>
Monitoring activity on the system is essential to performance tuning. The Oracle HTTP Server provides server side status information, including current server statistics, via the mod_status
module. To obtain these server status reports, you must configure the web server as described in the following sections.
To enable monitoring, edit the httpd.conf file to replace your_domain.com
with the hostname of the computer from which you want to monitor.
<Location /server-status>
your_domain.com
SetHandler server-status
Order deny, allow
Deny from all
Allow from
</Location>
Ensure that the ExtendedStatus
directive is set to On,
so that the maximum amount of information is displayed.
When you allow access from all domains, instead of just your_domain.com, you can monitor the server from machines outside of your domain, but be aware of the security implications of this: your server status is accessible from any site. It is probably best to specify the domain(s) from which you want to monitor your system.
With monitoring enabled, you can view current statistics from http://
hostname:port/server-status
where hostname:port is the hostname and port you want to monitor. These statistics help you to gain insight on how busy your system is.
The display includes:
Figure 2-1 is a screen capture of a server status page with ExtendedStatus
turned on.
The display (with ExtendedStatus
enabled) shows that 6 requests are being processed and four servers are idle. You can determine what stage of processing each server is in from the value in the M (Mode column).In Figure 2-1, 6 servers are sending replies and 4 servers are waiting for connections.
If your system has poor response times, or you suspect that httpd processes have stopped responding, look at the Req (request) column. It shows the number of milliseconds required to process the most recent request. Check to see if this number is greater than the time expected to service the request. If, after a request has been completed, there is a W in the M (mode) column for the process, the process is probably not responding.
Another situation that is important to monitor is that of the system being CPU bound, where CPU utilization is around 90%. The server status page displays CPU usage and the number of processes spawned. If the system is approaching the httpd process limit (the MaxClients
directive's setting in httpd.conf
), performance is poor, and the processes are all always busy, you may need to change your MaxClients
setting. See "Configuring the MaxClients Parameter".
Figure 2-1 is a snapshot of a server for a moment in time. You can get updated server statistics at any interval you choose by including the refresh parameter in the server-status URL:
http://servername:port/server-status?refresh=x
where servername:port is the name of the server and port number you are monitoring, and x is an integer representing the number of seconds after which the data is refreshed. For example, specify refresh=3
to update statistics every 3 seconds.
You may also find it useful to have the statistics displayed in a machine-readable format, for processing in a data analysis or spreadsheet program. To do this, add auto
to the end of the URL, as shown below:
http://servername:port/server-status?auto
The Apache Group provides a Perl script, log_server_status
, to automate server monitoring. It is included in the $ORACLE_HOME/Apache/Apache/bin/
directory.
The script is designed to be run by cron
(or an equivalent daemon that executes commands at intervals). To use the script, you must modify the following configuration variables in the script as shown in Table 2-3.
Enabling server status is very useful if an httpd process is not responding, and you need to identify that process. Operating system utilities such as ps
, top
, or pmap
do not identify which process is not responding.
After you start the Oracle9i Application Server, you can check to ensure that all JServ processes have started normally. If performance is degraded during operation, you can quickly determine if this is because JServ processes have terminated by looking at the Status column (each configured process has a status of Up
or Down
).
jserv.conf
file to enable monitoring and specify the host(s) that can access JServ status (the default is localhost
). Be aware of security implications when selecting the hosts that will be allowed to access status information on your system.
<Location /jserv/> SetHandler jserv-status order deny, allow deny from all allow from hostname_1.com allow from hostname_2.com </Location>
http://hostname:port/jserv/
The port must be the port on which the web server listens (found in the httpd.conf
file). Always include the trailing slash (/) in this URL. A "not found" error occurs if you omit the trailing slash.
A Configured Hosts column displays links to hosts.
The JServ status information for the host displays as shown in Figure 2-3.
Note:
The JServ status monitor shows all of the JServ processes that are configured in the |
The Status column shows the current shared memory (shm) state of each process.
The symbols that appear in parentheses after the word Up
or Down
have the following meanings:
|
![]() Copyright © 2001 Oracle Corporation. All Rights Reserved. |
|