Skip Headers

Oracle9i Application Server Oracle HTTP Server powered by Apache Performance Guide
Release 1 (v1.0.2.1) for AIX-Based Systems, Compaq Tru64 UNIX, HP 9000 Series HP-UX, Linux Intel, and Sun Solaris Intel

Part Number A90444-01
Go To Documentation Library
Library
Go To Table Of Contents
Contents
Go To Index
Index

Go to previous page Go to next page

2
Monitoring Your Web Server

This chapter describes 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:

Monitoring Processor Use

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 top to monitor process use.

Using the sar Utility (AIX, HP-UX, Intel Solaris)

You can use sar to sample cumulative activity counters in the operating system at specified intervals.

Report CPU Utilization

To determine process use, use the following sar command:

$ sar -u 5 5
:

This command samples CPU usage five times, in five second intervals, as shown below:

$ sar -u 5 5

15:30:25    %usr     %sys     %wio      %idle
15:30:30      49       36        0         14
15:30:35      52       41        0          7
15:30:40      46       45        0          8
15:30:45      46       44        0         10
15:30:50      50       41        0          9

Average       46       41        0          9

The statistics above show that the CPU was only 9% idle for the given time interval. If your performance criteria specify that CPU usage must be below a certain percentage, you can use sar to sample usage at a chosen interval during peak load times.

The sar command (-u option) provides the following statistics:

Table 2-1 CPU statistics, as reported by the sar utility
CPU Statistics  Description 

%usr 

percentage of time in which the processor is running in user mode 

%sys 

percentage of processes running in system time 

%wio 

percentage the processor spends waiting on I/O requests 

%idle 

percentage that the processor is idle 

Using the top Utility

You can use the top utility to view the ongoing processor activity in real time. Please refer to the man pages for usage.

Example:

$ top
4.:16pm up 15 days, 5:39 23 users, load average: 0.51, 0.38, 0.49
265 processes: 261 sleeping, 3 running, 1 zombie, 0 stopped
CPU states: 7.1% user, 44.3% system, 0.0% nice, 48.4% idle
Mem:  2009664K av, 1954828K used, 54836K free, 75288K shrd, 1448352K buff
Swap: 2096440K av,  10376K used, 2086064K free              250576K cached
  PID USER      PRI  NI   SIZE   RSS  SHARE  STAT  LIB %CPU %MEM  TIME COMMAND
20892 oasport     6   0  13908   13M   5068  R       0 24.9  0.6  0:06 oraweb
20928 oasport     7   0  13652   13M   4896  R       0 24.9  0.6  0:05 oraweb
20936 rkonanga    5   0   1252  1252    916  R       0  1.4  0.0  0:00 top
15187 oasport     0   0   2232  2232   1372  S       0  0.4  0.1  0:02 xterm
20728 oasport     0   0   2984  2984   1604  S       0  0.1  0.1  0:00 oasoorb
    1 root        0   0    156   136     92  S       0  0.0  0.0  0:04 init
    2 root        0   0      0     0      0  SW      0  0.0  0.0  0:10 kflushd
    3 root        0   0      0     0      0  SW      0  0.0  0.0  6.35 kupdate

Monitoring the Web Server

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.

Using the mod_status Utility to Monitor the Web Server

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>
SetHandler server-status
Order deny, allow
Deny from all
Allow from
your_domain.com
</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.

Figure 2-1 Server status page


Text description of svrstat.gif follows.
Text description of the illustration svrstat.gif

Interpreting Server Status Information

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".

Customizing the Server Status display

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

Figure 2-2 Server statistics display


Text description of svstauto.gif follows.
Text description of the illustration svstauto.gif

Logging Server Statistics to a File

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-2.

Table 2-2 Log status script variables
Variable  Value 

$wherelog 

The pathname of the log file location, for example:

/private/admin/logs/

The script creates a file name, such as: 20010945.  

$port 

Port number of the server to monitor. The default is 80.  

$server 

The server host name. The default is localhost

$request 

The server status request with the auto parameter as entered in the browser, for example:

http://servername:port/server-status?auto
 

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.

Monitoring JServ Processes

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).

  1. Remove the comments in the JServ status handler section of the 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>
    
    
    
    
  2. Type the following into your browser:

    	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.

  • Click the host to monitor.

    The JServ status information for the host displays as shown in Figure 2-3.

    Figure 2-3 JServ status display


    1


    Note:

    The JServ status monitor shows all of the JServ processes that are configured in the jserv.conf file, but not all of these may have been started, or any of them could be terminated. For example, Figure 2-3 shows four processes, but only two have a Status of Up (indicating that the process is able to service requests).  



    Text description of jsrvstat.gif follows.
    Text description of the illustration jsrvstat.gif

    The Status column shows the current shared memory (shm) state of each process.


    Note:

    The Status column is populated only for processes that are started in manual mode. It is not populated for a single process started in automatic mode.  


    The symbols that appear in parentheses after the word Up or Down have the following meanings:

    Symbol  Meaning 

    + 

    The process is running.  

    - 

    The process is stopped. 

    X 

    The process was terminated in a harsh shutdown. (existing requests were not handled before the process was terminated).  

    / 

    The process was terminated in a graceful shutdown (existing requests were handled before the process was terminated).  


  • Go to previous page Go to next page
    Oracle
    Copyright © 2001 Oracle Corporation.

    All Rights Reserved.
    Go To Documentation Library
    Library
    Go To Table Of Contents
    Contents
    Go To Index
    Index