Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 

 

 

Monitoring and Load Balancing the Oracle HTTP Server (OHS)

Oracle Application Server Tips by Burleson Consulting

The HTTP Server is an important part of the Oracle9iAS architecture because a delay at this level will delay initial connection to your Oracle9iAS system and also cause delays in the generation and dispatch of outgoing HTML and XML documents.

As we noted in Chapter 1, connection to OHS required several round-trips while establishing connectivity (Figure 10.6).

Figure 10.6: OHS entry procedure

Because OHS is used at least twice during every web transaction, we must be able to identify the components of OHS processing and find a way to track each component process.  Next, let?s examine the common tools used to monitor the OHS server and report on performance metrics.

Monitoring Oracle9iAS with Dynamic Monitoring Service (dmstool)

The Dynamic Monitoring service dmstool utility is a command line program that is used to display elapsed time performance metrics.  The dmstool utility can be used to view metrics on several Oracle9iAS components:

  • OC4J ? dmstool can measure the time required to parse incoming requests and the total free RAM in the JVM.

  • Oracle9iAS Portal ? Important Portal metrics can be easily displayed.

  • Servlet code ? You can add dms metrics of any Java code to capture additional statistics.

  • Oracle HTTP Server (OHS) ? dmstool can measure the current active requests in the HTTP server.

Before we explore the command syntax for dmstool we need to note that you can use your browser to quickly look at detailed dms statistics. 

Browser-based statistics viewing

You can see the raw dmstool statistics by reviewing the httpd.conf file and finding the URL for the dms dump file.  Invoking the dms URL will display the raw dms data in your browser (Figure 10.7).  Here we issue the http://appsvr.localdomain.com:7778/dms0 URL and see the dms data:

Figure 10.7: Displaying the dms raw data with your browser

You can also use URL-based queries to locate server performance data (Figure 10.8).  Here we invoke the http://appsvr.localdomain.com:7778/server-status URL and see details on the Apache server status:

Figure 10.8: Displaying the dms raw data with your browser

Extending dms for Java code

As we have noted, you can capture you own dms diagnostics.  Let?s look at how you can add dms metrics to a servlet.  In the example below we see that the prints ?This is a test? (Listing 10.5).

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class  Test  extends HttpServlet  
{
  public void doGet(HttpServletRequest request,   HttpServletResponse response )
    throws ServletException, IOException  
    {
    response.getWriter().println("This is a Test. " );
  }
}

Listing 10.5: Java servlet without dms

Now we can take this code and add a dms metric by importing the oracle dms instrument library and adding a display message each time the servlet is executed (Listing 10.6):

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import oracle.dms.instrument.*;

public class  TestA  extends HttpServlet  
{
  public void doGet(HttpServletRequest request,   HttpServletResponse response )
    throws ServletException, IOException  
    {
        Event  beginAccess  = Event.create("/ oracle / TestA / dms ",
                            " TestA Write Succeded");
   res.getWriter().println(" This is a test of Test. ");
    begin Access.occurred();
    }
}

Listing 10.6: Servlet with dms instrumentation

Now that we have reviewed the basics we are ready to take a close look at issuing native dmstool commands to extract Oracle9iAS performance data.

Using dmstool commands

When using the dmstool list option (-l), you will generate a list of over 300 monitoring metrics for Oracle9iAS.  In the example below, we constrain the dmstool output to only those lines that contain the ?completed? string:

#!/bin/ksh

PATH=$PATH:/home/oracle/oraportal904/bin
export PATH

dmstool -l |grep completed

The output of this script (Listing 10.7) will show us all of the available metrics containing the word ?completed?.  We will use this list as input to a more detailed dmstool command in the next step.

/appsvr.lcldm.com/OC4J:3303:6004/oc4j/default/WEBs/parseRequest.completed
/appsvr.lcldm.com/OC4J:3303:6004/oc4j/default/WEBs/processRequest.completed
/appsvr.lcldm.com/OC4J:3303:6004/oc4j/default/WEBs/resolveContext.completed
/appsvr.lcldm.com/OC4J:3303:6004/oc4j/portal/WEBs/parseRequest.completed
/appsvr.lcldm.com/OC4J:3303:6004/oc4j/portal/WEBs/processRequest.completed
/appsvr.lcldm.com/OC4J:3303:6004/oc4j/portal/WEBs/resolveContext.completed
/appsvr.lcldm.com/OC4J:3303:6004/oc4j/syndserver/WEBs/parseRequest.completed
/appsvr.lcldm.com/OC4J:3303:6004/oc4j/syndserver/WEBs/processRequest.completed
/appsvr.lcldm.com/OC4J:3303:6004/oc4j/syndserver/WEBs/resolveContext.completed

Listing 10.7:  Sample dmstool listing for completed requests

Note: the Oracle9iAS parameters are generally specified in ?Camel? notation.  This is the convention where the words are concatenated together, and all words after the first are Capitalized, creating the ?humps? which characterize Camel notation.

We can use this listing of completed operations to get counts of the total operations over a specific period of time.  Let?s use this list as input parameters for more advanced dmstool commands.

Summarizing dmstool data by time intervals

Using the dmstool with the interval option (-i) and the collection option (-c).  The dmstool command specifies the collection of 100 sets of data at 60-second intervals.

#!/bin/ksh
PATH=$PATH:/home/oracle/oraportal904/bin
export PATH

dmstool -i 60 -c 100 \
/appsvr.localdomain.com/Apache:2534:6004/Apache/handle.completed     \
/appsvr.localdomain.com/Apache:2534:6004/Apache/request.completed    \
/appsvr.localdomain.com/Apache:2534:6004/Apache/handle.completed     \
/appsvr.localdomain.com/Apache:2534:6004/Apache/request.completed  > t1.lst


Here is the output from this script.  Here we see the cumulative number of operations, displayed every minute, for each handle, request and completion operation (Listing 10.8):

Sun Jul 13 20:19:43 MDT 2003

/appsvr.localdomain.com/Apache:2534:6004/Apache/handle.completed    240320 ops
/appsvr.localdomain.com/Apache:2534:6004/Apache/request.completed   146504 ops
/appsvr.localdomain.com/Apache:2534:6004/Apache/connection.completed 56908 ops

Sun Jul 13 20:20:43 MDT 2003

/appsvr.localdomain.com/Apache:2534:6004/Apache/handle.completed    240474 ops
/appsvr.localdomain.com/Apache:2534:6004/Apache/request.completed   146598 ops
/appsvr.localdomain.com/Apache:2534:6004/Apache/connection.completed 56948 ops
Sun Jul 13 20:21:43 MDT 2003
/appsvr.localdomain.com/Apache:2534:6004/Apache/handle.completed    240668 ops
/appsvr.localdomain.com/Apache:2534:6004/Apache/request.completed   146732 ops
/appsvr.localdomain.com/Apache:2534:6004/Apache/connection.completed 56978 ops

Sun Jul 13 20:22:43 MDT 2003

/appsvr.localdomain.com/Apache:2534:6004/Apache/handle.completed    240825 ops
/appsvr.localdomain.com/Apache:2534:6004/Apache/request.completed   146829 ops
/appsvr.localdomain.com/Apache:2534:6004/Apache/connection.completed 57028 ops

Listing 10.8: Display cumulative operations

By itself, this output does not show the marginal changes between time periods, but you can either write a program or paste the output into an MS-Excel spreadsheet and use the chart wizard to plot the changes (Figure 10.9).  Here is a sample of the time-based changes to the three OHS server operations counts:

Figure 10.9: Plotting dmstool output with MS-Excel



This is an excerpt from "Oracle 10g Application Server Administration Handbook" by Don Burleson and John Garmany.
 

If you like Oracle tuning, you may enjoy the new book "Oracle Tuning: The Definitive Reference", over 900 pages of BC's favorite tuning tips & scripts. 

You can buy it direct from the publisher for 30%-off and get instant access to the code depot of Oracle tuning scripts.


 

 
��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2017

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

Remote Emergency Support provided by Conversational