Getting Application Module Pool Statistics to Aid with Size Tuning

Send me a mail
 Dive into Oracle ADF   Click to see the XML version of this web page.   (Updated: 2/3/2008; 9:25:04 PM.)
Tips and tricks from Steve Muench on Oracle ADF Framework and JDeveloper IDE

Getting Application Module Pool Statistics to Aid with Size Tuning

Chapter 29, "Understanding Application Module Pooling", in the ADF Developer's Guide for Forms/4GL Developers explains all of the application module tuning parameters that you can set.

To better understand what settings might be optimal for your particular application, you need statistics that you can print out after running your application under a simulated load. ADF/BC4J have admin features that are part of Oracle Enterprise Manager that allow you to see this information, but if you want a quick solution that will work in any J2EE container where you're running your ADF application, you can check out Example #83 here on my blog:

Dump Application Module Pooling Statistics Servlet

The servlet-based approach illustrated in the example above works best for 10.1.3 and beyond. If you are using JDeveloper 10.1.2, you can also just add the following DumpPoolStatistics.jsp page into your web root directory.

<%@page import="
java.io.IOException,
java.io.PrintWriter,
java.util.Enumeration,
javax.servlet.ServletConfig,
javax.servlet.ServletException,
javax.servlet.http.HttpServlet,
javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse,
oracle.jbo.common.ampool.ApplicationPool,
oracle.jbo.common.ampool.PoolMgr"%>
<html>
  <head><title>DumpPoolStatistics</title></head><%
    PoolMgr poolMgr = PoolMgr.getInstance();
    String poolname = request.getParameter("poolname");
    if (poolname == null || poolname.equals("")) {
      Enumeration keys = poolMgr.getPoolNames();
      if (keys != null) {
        out.println("<h3>List of Active Application Module Pools</h3>");
        out.println("<ul>");
        while (keys.hasMoreElements()) {
          String s = (String)keys.nextElement();
          out.println("<li><code><a href='DumpPoolStatistics.jsp?poolname="+
          s+"'>"+s+"</a></code></li>");
        }
        out.println("</ul>");
      }
      else {
        out.println("No pools.");
      }
    }
    else {
      out.println("<h3>Pool Statistics for Pool '"+poolname+"'</h3>");
      out.println("<a href='DumpPoolStatistics.jsp'>Back to Pool List</a>");
      out.println("<hr><blockquote><pre>");
      ApplicationPool pool =  (ApplicationPool)poolMgr.getResourcePool(poolname);
      pool.dumpPoolStatistics(new PrintWriter(out));
      out.println("</pre></blockquote>");
    }
%>

After running your application (or at any time during the simulated load test, you can browse this DumpPoolStatistics.jsp page and get the list of AM pools. Click on an AM pool's name to see the runtime statistics for that pool.

There is a similar page you can create to quickly dump pooling statistics for the BC4J Connection pools as well. I've included both DumpPoolStatistics.jsp and DumpConnectionPoolStatistics in this DumpStatisticsPages.zip file for your convenience.

 



© Copyright 2008 Steve Muench. Click here to send an email to the editor of this weblog.
Last update: 2/3/2008; 9:25:04 PM.