<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
   <title>WebLogic Server Performance</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/WLSPERFORMANCE/" />
   <link rel="self" type="application/atom+xml" href="http://blogs.oracle.com/WLSPERFORMANCE/xml/rss.xml" />
   <id>tag:blogs.oracle.com,2009:/WLSPERFORMANCE//2298</id>
   <updated>2009-10-21T16:42:34Z</updated>
   <subtitle>This blog is dedicated to all things related to evaluating the performance of WebLogic Server based implementations.  It covers the tools used to evaluate performance as well as various approaches to tuning.</subtitle>
   <generator uri="http://www.sixapart.com/movabletype/">Movable Type Enterprise 4.23-en</generator>


<entry>
   <title>Threading, MDBs, and the Mysterious Power of 16</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/WLSPERFORMANCE/2009/10/threading_mdbs_and_the_impact.html" />
   <id>tag:blogs.oracle.com,2009:/WLSPERFORMANCE//2298.15136</id>
   
   <published>2009-10-21T12:27:49Z</published>
   <updated>2009-10-21T16:42:34Z</updated>
   
   <summary>There was a pretty interesting post to one of our internal mailing lists regarding an issue that a customer was seeing when trying to scale up their application.&#160;&#160; The application architecture was a fairly common one in which the WebLogic...</summary>
   <author>
      <name>charles.paclat</name>
      
   </author>
   
      <category term="General WebLogic Configuration" scheme="http://www.sixapart.com/ns/types#category" />
   
      <category term="Performance Configuration Tuning" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="weblogicservermdbworkmanagerthreading" label="weblogic server mdb workmanager threading" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/WLSPERFORMANCE/">
      <![CDATA[<p>There was a pretty interesting post to one of our internal mailing lists regarding an issue that a customer was seeing when trying to scale up their application.&#160;&#160; The application architecture was a fairly common one in which the WebLogic Server was accepting batch type requests via a JMS queue.&#160; The requests were then processed by an MDB.&#160; The system is backed by a really substantial RAC instance and the team was hoping to see the system processing lots and lots of requests concurrently.&#160;&#160; The test driver that they created was generating on the order of 100 concurrent requests, yet when they looked at the server they found that at most there were 16 threads being created.&#160;&#160;&#160;&#160; </p>  <p>Initially the team assumed that they were somehow being constrained by the number of jdbc connections and tried increasing the number of connections in the pool.&#160; They found that this did not get them any increased concurrency.&#160; Next they increased the max beans in pool for the MDB, but still this did not help either.&#160;&#160;&#160; </p>  <p>What is happening in this case is that the WebLogic Server MDB container is trying to protect against externally generated asynchronous work overwhelming the server.&#160; It helps to consider that such batch requests are frequently long running and may consume considerable resources.&#160;&#160; As the default for max beans in pool is 1000 it is possible to quickly overwhelm a server with a large number of concurrent requests and monopolize the servers resources.</p>  <p>In response to many such issues the decision was made by the EJB container team to limit the number JMS consumers to 16.&#160; This has the effect of constraining the number of concurrent requests that are dispatch to 16.&#160; The mechanism that is provided to remove this artificial limit is to configure a separate work manager and associated explicitly with that MDB.&#160; In doing so you are telling the container that you are aware of the issue and are taking control of the situation.</p>  <p>The <a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/e13814/mdbtuning.htm#PERFM271">Tuning Message-Driven Beans</a> chapter of the <a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/e13814/toc.htm">Performance &amp; Tuning</a> book describes MDB concurrency in detail and explains all about this issue and describes lots of options.&#160;&#160; To get a better understanding of work managers and how they can be used to balance the work load in a server there is an excellent white paper entitled <a href="http://www.oracle.com/technology/pub/articles/dev2arch/2006/01/workload-management.html">Workload Management in WebLogic Server.</a></p>  <p>The following example should get you started and can be done completely in the context of the weblogic-ejb-jar.xml.&#160;&#160; </p>  <p>&#160;</p>  <p><font face="Courier New" size="2">&lt;?xml version=&quot;1.0&quot;?&gt;      <br />&lt;weblogic-ejb-jar xmlns=</font><a href="http://www.bea.com/ns/weblogic/10.0"><font face="Courier New" size="2">http://www.bea.com/ns/weblogic/10.0</font></a><font face="Courier New" size="2">&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; xmlns:j2ee=</font><a href="http://java.sun.com/xml/ns/j2ee"><font face="Courier New" size="2">http://java.sun.com/xml/ns/j2ee</font></a><font face="Courier New" size="2">      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; xmlns:xsi=</font><a href="http://www.w3.org/2001/XMLSchema-instance"><font face="Courier New" size="2">http://www.w3.org/2001/XMLSchema-instance</font></a><font face="Courier New" size="2">      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; xsi:schemaLocation=&quot;</font><a href="http://www.bea.com/ns/weblogic/10.0"><font face="Courier New" size="2">http://www.bea.com/ns/weblogic/10.0</font></a>     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font face="Courier New" size="2">&#160;</font><a href="http://www.bea.com/ns/weblogic/950/weblogic-ejb-jar.xsd&quot;"><font face="Courier New" size="2">http://www.bea.com/ns/weblogic/950/weblogic-ejb-jar.xsd&quot;</font></a><font face="Courier New" size="2">&gt;</font></p>  <p><font face="Courier New" size="2">&#160; ...</font></p>  <p><font face="Courier New" size="2">&#160; &lt;weblogic-enterprise-bean&gt;      <br />&#160;&#160;&#160;&#160; &lt;ejb-name&gt;SomeMDB&lt;/ejb-name&gt;       <br />&#160;&#160;&#160;&#160; &lt;message-driven-descriptor&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160; &lt;destination-jndi-name&gt;jms/SomeQueue&lt;/destination-jndi-name&gt;       <br />&#160;&#160;&#160;&#160; &lt;/message-driven-descriptor&gt;       <br />&#160;&#160;&#160;&#160; &lt;jndi-name&gt;SomeMDB&lt;/jndi-name&gt;       <br />&#160;&#160;&#160;&#160; &lt;dispatch-policy&gt;mdb_workmanager&lt;/dispatch-policy&gt;       <br />&#160;&#160; &lt;/weblogic-enterprise-bean&gt; </font></p>  <p><font face="Courier New" size="2">&#160; ...</font></p>  <p><font face="Courier New" size="2">&#160; &lt;work-manager&gt;      <br />&#160;&#160;&#160; &lt;name&gt;mdb_workmanager&lt;/name&gt;       <br />&#160;&#160;&#160; &lt;max-threads-constraint&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160; &lt;name&gt;maxthreads_32&lt;/name&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160; &lt;count&gt;32&lt;/count&gt;       <br />&#160;&#160;&#160; &lt;/max-threads-constraint&gt;       <br />&#160; &lt;/work-manager&gt;</font></p>  <p><font face="Courier New" size="2">&lt;/weblogic-ejb-jar&gt;</font>&#160; </p>  <p>&#160;</p>  <p>With this work manager configuration&#160; in place the server will always make sure that if there are no more than 32 threads dedicated to processing requests to this MDB.&#160;&#160; </p>]]>
      
   </content>
</entry>

<entry>
   <title>Interesting Research from Germany</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/WLSPERFORMANCE/2009/10/interesting_research_from_germ.html" />
   <id>tag:blogs.oracle.com,2009:/WLSPERFORMANCE//2298.14723</id>
   
   <published>2009-10-02T18:20:21Z</published>
   <updated>2009-10-02T18:20:24Z</updated>
   
   <summary>Over two years ago I had the pleasure to make the acquaintance of making the Samuel Kounev.&#160; I had recently been given the opportunity to define the role of Performance Lead for the WebLogic Server Development team and I was...</summary>
   <author>
      <name>charles.paclat</name>
      
   </author>
   
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/WLSPERFORMANCE/">
      <![CDATA[<p>Over two years ago I had the pleasure to make the acquaintance of making the Samuel Kounev.&#160; I had recently been given the opportunity to define the role of Performance Lead for the WebLogic Server Development team and I was looking beyond the usual sources for information on performance modeling of JEE.&#160; It was then that I stumbled across Samuel’s work in a search of the web.&#160;&#160; I exchanged emails and then later learned connected to Samuel through some of my work with the SPEC benchmarks with which he was also involved.&#160;&#160; BEA had previously supported some of his research by providing access to technology and I was interested in continuing to foster what I believed to be some truly novel approaches to performance modeling.</p>  <p>One year and one acquisition later we had worked out the details by which Oracle could provide support for this research.&#160;&#160; Fabian Brosig, a diploma student, took up the torch and what followed was a fruitful year of collaboration. The result of this work was a degree for Fabian, some really good feedback into the WLS diagnostics capabilities and <a href="http://www.oracle.com/technology/pub/articles/brosig-wldf.html">really interesting publication for the OTN</a>.</p>  <p>Besides providing insight into the issue of performance modeling it also serves as a practical demonstration of how to use the WebLogic Diagnostics framework.&#160; </p>  <p>Thanks again to Samuel and Fabian for all of their diligence and to the WLDF team for their support.</p>]]>
      
   </content>
</entry>

<entry>
   <title>XML Entity Caching in WebLogic Server</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/WLSPERFORMANCE/2009/07/xml_entity_caching_in_weblogic.html" />
   <id>tag:blogs.oracle.com,2009:/WLSPERFORMANCE//2298.13607</id>
   
   <published>2009-07-31T20:51:03Z</published>
   <updated>2009-07-31T20:56:26Z</updated>
   
   <summary>A little know feature of the WebLogic Server implementation is something called the XML Registry.&#160; In many applications it is still common to receive an XML document as a post to a servlet and then parse that document and translate...</summary>
   <author>
      <name>charles.paclat</name>
      
   </author>
   
      <category term="Performance Configuration Tuning" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="dtd" label="DTD" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="weblogicserver" label="WebLogic Server" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="xmlentitycaching" label="XML Entity Caching" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="xmlparsing" label="XML Parsing" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="xsd" label="XSD" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/WLSPERFORMANCE/">
      <![CDATA[<p>A little know feature of the WebLogic Server implementation is something called the XML Registry.&#160; In many applications it is still common to receive an XML document as a post to a servlet and then parse that document and translate the contents into calls to various local services.&#160; This approach was a common early step in the movement towards web services and there are are still plenty of applications out there with similar logic.&#160;&#160; </p>  <p>In the WebLogic Server the XMLRegistry interposes a server specific implementation of the various SAX and DOM parsers and the services used to resolve the entities that are encountered during parsing.&#160;&#160; As part of optimizing the server for optimal benchmark performance we spent a bunch of cycles during the 10.3 release to improve the efficiency of this code and to eliminate a number of areas of contention.&#160; We also noticed that the default parsers were repeatedly downloading the dtd for the documents that were being parsed.&#160;&#160; By configuring the XML registry we were able to dramatically reduce the number of outbound requests to download the dtds during our testing.&#160;&#160; </p>  <p>To see what is going on lets look at a diagram of a somewhat typical application.&#160; In this case we have two applications which are exchanging order and delivery documents each of which is validated with a DTD.&#160; It can be seen that the way the application was written each request is parsed in the servlet. While it is parsed the underlying XML parser retrieves the DTD that is needed to validate it and thus blocked.&#160; This ties up a thread on both the sending and receiving application servers.</p>  <p>&#160;<a href="http://blogs.oracle.com/WLSPERFORMANCE/WindowsLiveWriter/XMLEntityCachinginWebLogicServer_CC6C/xml_registry_pic_1_6.png"><img title="xml_registry_pic_1" style="border-right: 0px; border-top: 0px; display: inline; margin-left: 0px; border-left: 0px; margin-right: 0px; border-bottom: 0px" height="397" alt="xml_registry_pic_1" src="http://blogs.oracle.com/WLSPERFORMANCE/WindowsLiveWriter/XMLEntityCachinginWebLogicServer_CC6C/xml_registry_pic_1_thumb_2.png" width="644" border="0" /></a></p>  <p>&#160;</p>  <p>By enabling the XMLRegistry the request to retrieve the required entity is trapped in the XML Registry and resolved against a local cache.&#160; This avoids repeated calls between servers and eliminates the latency in the initial processing and also in the session that is making the initial post.&#160;&#160; This reduces the number of active threads on both servers that are involved in the processing. </p>  <p>&#160;</p>  <p></p>  <p></p>  <p></p>  <p></p>  <p><a href="http://blogs.oracle.com/WLSPERFORMANCE/WindowsLiveWriter/XMLEntityCachinginWebLogicServer_CC6C/xml_registry_pic_2_2.png"><img title="xml_registry_pic_2" style="border-right: 0px; border-top: 0px; display: inline; margin-left: 0px; border-left: 0px; margin-right: 0px; border-bottom: 0px" height="456" alt="xml_registry_pic_2" src="http://blogs.oracle.com/WLSPERFORMANCE/WindowsLiveWriter/XMLEntityCachinginWebLogicServer_CC6C/xml_registry_pic_2_thumb.png" width="644" border="0" /></a> </p>  <p>&#160;</p>  <p>This works because it in most cases the contents of the DTD are very, very unlikely to change.&#160; Any change would be well coordinated between the communicating parties.&#160; The downside to such an approach is that if the DTD or XSD were to change there could be any number of failed requests.&#160; Handling that would require special coding in the applications&#160;&#160; In the 10.3 release additional functionality was added to address even this unlikely occurrence (<a title="http://e-docs.bea.com/wls/docs103/issues/known_resolved.html" href="http://e-docs.bea.com/wls/docs103/issues/known_resolved.html">http://e-docs.bea.com/wls/docs103/issues/known_resolved.html</a>).</p>  <p><code>The “handle-entity-invalidation” feature that was added to the XML Registry tells the interposed parser handler to trap any parsing failures and first verify if they are the result of changes to the XML entity that is being used to validate the document.&#160; When it encounters these errors it will download a fresh copy of the entity and compare it to the entity in the cache.&#160; If it is changed it will reinitiate the parse.&#160; If that parse is successful the application will continue on as if nothing happened and be none the wiser.&#160;&#160; Subsequent failure are reported in the standard way.</code></p>  <p><code>Enabling this set of features is a great way to get better performance out of existing applications without having to do any code rework. </code><code>The example code below shows how to configure this capability in the WLS config.xml&#160; It can also be configured through WLST scripting.&#160; The only trick is to make sure that the system-id and public-id match the values that are in the documents that you are receiving from the counterparty.&#160; </code></p>  <p><code>Another little tweak that might help performance some even if you don’t enable entity caching, is replacing the default document builder factory.&#160; We found that the implementation below was working better than the default implementation of&#160; “weblogic.apache.xerces.jaxp.DocumentBuilderFactoryImpl” specified in releases prior to 10.1.&#160; In 10.3 this was updated and so you won’t need to make this change to get the performance benefit.</code></p>  <p><font face="Courier New" size="1">&lt;xml-registry&gt;      <br />&lt;name&gt;dtdCache&lt;/name&gt;       <br />&#160;</font><font size="1"><font face="Courier New"><strong>&lt;document-builder-factory&gt;          <br />&#160;&#160; com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl           <br />&lt;/document-builder-factory&gt;           <br /></strong>&lt;xml-entity-spec-registry-entry&gt;         <br />&#160;&#160; &lt;name&gt;deliveryResponse&lt;/name&gt;         <br />&#160;&#160; &lt;public-id&gt;DELIVERY&lt;/public-id&gt;         <br />&#160;&#160; &lt;system-id&gt;         <br />&#160;&#160;&#160;&#160;&#160; http://acme:7011/Emulator/dtd/delivery.dtd         <br />&#160;&#160; &lt;/system-id&gt;         <br />&#160;&#160; &lt;entity-uri&gt;         <br />&#160;&#160;&#160;&#160; </font></font><font face="Courier New" size="1">http://acme:7011/Emulator/dtd/delivery.dtd</font>     <br /><font face="Courier New" size="1">&#160;&#160; &lt;/entity-uri&gt;      <br />&#160;&#160; &lt;when-to-cache&gt;cache-on-reference&lt;/when-to-cache&gt;       <br />&#160;&#160; &lt;cache-timeout-interval&gt;60000&lt;/cache-timeout-interval&gt;       <br />&#160;&#160; </font><font size="1"><font face="Courier New"><strong>&lt;handle-entity-invalidation&gt;true&lt;/handle-entity-invalidation&gt;          <br /></strong>&lt;/xml-entity-spec-registry-entry&gt;         <br />&lt;/xml-registry&gt;</font></font></p>  <p><code><font face="Courier New" size="2"></font></code></p>]]>
      
   </content>
</entry>

<entry>
   <title>JPA and WLS JDBC Configuration</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/WLSPERFORMANCE/2009/07/jpa_and_wls_jdbc_configuration.html" />
   <id>tag:blogs.oracle.com,2009:/WLSPERFORMANCE//2298.13268</id>
   
   <published>2009-07-09T20:37:02Z</published>
   <updated>2009-07-09T20:57:16Z</updated>
   
   <summary>While not strictly related to performance I did come across an interesting tidbit today that I think is worth sharing.&#160;&#160; I have been working with JPA based application that has a persistence.xml that is set up to provide the person...</summary>
   <author>
      <name>charles.paclat</name>
      
   </author>
   
      <category term="General WebLogic Configuration" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="connectionpools" label="Connection Pools" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="jdbc" label="JDBC" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="jpa" label="JPA" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="weblogic" label="WebLogic" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="descriptors" label="descriptors" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/WLSPERFORMANCE/">
      <![CDATA[<p>While not strictly related to performance I did come across an interesting tidbit today that I think is worth sharing.&#160;&#160; I have been working with JPA based application that has a persistence.xml that is set up to provide the person deploying the application with some flexibility when defining the data sources.&#160;&#160; </p>  <p><font face="Courier New" size="2">&lt;persistence xmlns=&quot;</font><a href="http://java.sun.com/xml/ns/persistence&quot;"><font face="Courier New" size="2">http://java.sun.com/xml/ns/persistence&quot;</font></a><font face="Courier New" size="2"> version=&quot;1.0&quot;&gt;      <br />&#160; &lt;persistence-unit name=&quot;Order&quot;&gt;       <br />&#160;&#160;&#160; &lt;jta-data-source&gt;<strong><u>jdbc/OrderDS</u></strong>&lt;/jta-data-source&gt;       <br />&#160;&#160;&#160; &lt;class&gt;foo.bar.orders.Customer&lt;/class&gt;       <br />&#160;&#160;&#160; &lt;class&gt;foo.bar.orders.Order&lt;/class&gt;       <br />&#160;&#160;&#160; &lt;class&gt;foo.bar.orders.OrderLine&lt;/class&gt;       <br />&#160; &lt;/persistence-unit&gt;       <br />&#160; &lt;persistence-unit name=&quot;Mfg&quot;&gt;       <br />&#160;&#160;&#160; &lt;jta-data-source&gt;<strong>jdbc/MfgDS</strong>&lt;/jta-data-source&gt;       <br />&#160;&#160;&#160; &lt;class&gt;foo.bar.mfg.Assembly&lt;/class&gt;       <br />&#160;&#160;&#160; &lt;class&gt;foo.bar.mfg.Component&lt;/class&gt;       <br />&#160;&#160;&#160; &lt;class&gt;foo.bar.mfg.Inventory&lt;/class&gt;       <br />&#160;&#160;&#160; &lt;class&gt;foo.bar.mfg.WorkOrder&lt;/class&gt;       <br />&#160; &lt;/persistence-unit&gt;       <br />&lt;/persistence&gt;</font></p>  <p>The first reaction when confronted with this descriptor might be to deploy multiple connection pools one for each persistence unit.&#160; This may even be appropriate in some cases because if could be that you are actually going to different back end systems.&#160; </p>  <p>If you happen to know that you are actually hitting the same back end database you may think that your only choice is to modify the persistence.xml to point them to a common data source.&#160; Fortunately, WLS provides the flexibility of providing multiple jndi names for each data source.&#160;&#160; </p>  <p><font face="Courier New" size="2">&lt;jdbc-data-source xmlns=&quot;</font><a href="http://www.bea.com/ns/weblogic/90&quot;"><font face="Courier New" size="2">http://www.bea.com/ns/weblogic/90&quot;</font></a><font face="Courier New" size="2"> xmlns:xsi=&quot;</font><a href="http://www.w3.org/2001/XMLSchema-instance&quot;"><font face="Courier New" size="2">http://www.w3.org/2001/XMLSchema-instance&quot;</font></a><font face="Courier New" size="2">&gt;      <br />&#160; &lt;name&gt;specjds-jdbc&lt;/name&gt;       <br />&#160; &lt;jdbc-driver-params&gt;       <br />&#160;&#160;&#160; &lt;url&gt;@DATABASE_URI@&lt;/url&gt;       <br />&#160;&#160;&#160; &lt;driver-name&gt;@DATABASE_DRIVER@&lt;/driver-name&gt;       <br />&#160;&#160;&#160; &lt;properties&gt;       <br />&#160;&#160;&#160;&#160;&#160; &lt;property&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;name&gt;user&lt;/name&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;value&gt;@DATABASE_USER@&lt;/value&gt;       <br />&#160;&#160;&#160;&#160;&#160; &lt;/property&gt;       <br />&#160;&#160;&#160;&#160;&#160; &lt;property&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;name&gt;password&lt;/name&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;value&gt;@DATABASE_PASSWORD@&lt;/value&gt;       <br />&#160;&#160;&#160;&#160;&#160; &lt;/property&gt;       <br />&#160; &lt;/jdbc-driver-params&gt;       <br />&#160; &lt;jdbc-connection-pool-params&gt;       <br />&#160;&#160;&#160; &lt;initial-capacity&gt;32&lt;/initial-capacity&gt;       <br />&#160;&#160;&#160; &lt;max-capacity&gt;64&lt;/max-capacity&gt;       <br />&#160;&#160;&#160; &lt;capacity-increment&gt;4&lt;/capacity-increment&gt;       <br />&#160;&#160;&#160; &lt;statement-cache-size&gt;128&lt;/statement-cache-size&gt;       <br />&#160; &lt;/jdbc-connection-pool-params&gt;       <br />&#160; &lt;jdbc-data-source-params&gt;       <br />&#160;&#160;&#160; &lt;jndi-name&gt;<strong>jdbc/OrderDS</strong>&lt;/jndi-name&gt;       <br />&#160;&#160;&#160; &lt;jndi-name&gt;<strong>jdbc/MfgDS</strong>&lt;/jndi-name&gt;       <br />&#160; &lt;/jdbc-data-source-params&gt;       <br />&lt;/jdbc-data-source&gt;</font></p>  <p>This is a handy way of mapping from JPA onto your database configuration without having to perform any manipulation of the descriptors that are embedded inside the application archive.</p>  <p>&#160;</p>  <p><font face="Courier New" size="2">&#160;</font></p>]]>
      
   </content>
</entry>

<entry>
   <title>Basics of using JRA with WLS</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/WLSPERFORMANCE/2009/07/basics_of_using_jra_with_wls.html" />
   <id>tag:blogs.oracle.com,2009:/WLSPERFORMANCE//2298.13249</id>
   
   <published>2009-07-08T20:33:47Z</published>
   <updated>2009-07-08T20:59:19Z</updated>
   
   <summary>I have been wanting to start a blog about issues related to WebLogic Server Performance for some time now, but have always found it hard to get off the ground.&#160; To make this easy I thought that I should start...</summary>
   <author>
      <name>charles.paclat</name>
      
   </author>
   
   <category term="jrockit" label="JRockit" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="missioncontrol" label="Mission Control" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="profiling" label="Profiling" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="weblogicserver" label="WebLogic Server" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/WLSPERFORMANCE/">
      <![CDATA[<p>I have been wanting to start a blog about issues related to WebLogic Server Performance for some time now, but have always found it hard to get off the ground.&#160; To make this easy I thought that I should start off posting about a tool that I use regularly while trying to identify performance issues in the WLS code base.&#160;&#160; </p>  <p>We in the WebLogic Server development team spend a fair amount of time trying to identify parts of the product where we should focus our attention.&#160;&#160; The most common way of doing this is to collect a profile of the system while it is running.&#160;&#160; There are a number of really good java profiling tools out there that can be used to analyze a particular scenario from end to end while the system is not under load.&#160; JProfiler is one that I really like and that has some really useful capabilities.&#160; The problem with most of these tools is that under load they tend to impact the performance of the application itself and thus have limited usefulness in these scenarios.</p>  <p>The JRockit Runtime Analyzer is a tool that can be used even on a very heavily loaded system with very little impact.&#160; The reason is that the creation of a JRA profile takes advantage of information that is already being maintained by the VM to identify parts of the code to focus on for optimization.&#160;&#160; We have actually measured the impact of collecting profiles to be less than 1% in most cases. Because of this we collect JRA profiles during many of our benchmarking runs.</p>  <p>The easiest and least intrusive way that I have found to collect these profiles is to add options to the java command used to start the server instance.&#160;&#160; This is particularly useful when running automated benchmarks.&#160; It should be noted that it is also really easy to trigger a JRA profile using the JRockit Mission Control or the newer plugin for Eclipse.&#160; The simple command below will generate a JRA recording 3 minutes after the JVM is started and record for a one minute period.&#160;&#160; It also specifies a location into which to place thee file and a stack trace depth of 64. </p>  <p><strong><font face="Courier New" size="2">-XXjra:delay=180,recordingtime=60,filename=./snapshots/jrarecording.xml,tracedepth=64</font></strong></p>  <p>The default for stack trace depth is only 16, so it is important that you increase that value so that you can actually get down into your own application code.&#160;&#160; </p>  <p>What is going on behind the scenes is that the JRockit VM is periodically stopping a certain number of threads and sampling the register that tells it what piece of code is executing.&#160; It also samples the full stack at a somewhat less frequent interval and that is where the stack trace depth come into play.&#160; </p>  <p>For modern applications that are running in an application server container there is often a fair amount of code that sits in front of your application code.&#160;&#160; Trimming the stack at 16 will often mean that you are just getting to our own code when the stack is trimmed and thus you may miss the good part.</p>  <p>The resulting profile can be loaded using JRockit Mission Control(<strong>jrmc</strong>) or the newer JRA plugin to Eclipse.</p>  <p>The screenshot below is of a <strong>jrmc</strong> session shows the information in the “Methods” tab.&#160;&#160; One useful approach that I often use is to filter on “*ExecuteThread.run”.&#160; These are the methods that the WebLogic Server thread scheduling mechanism uses to do application work.&#160;&#160; </p>  <p>One interesting thing to note is that there are two of the same method.&#160; The one that has the little lightning bolt has been optimized by the JVM.&#160; This indicates that the method was optimized and replaced during the recording period.&#160; To the JVM these are actually two separate methods.&#160;&#160; Note also that these numbers reflect the number of times that the method itself was sampled.&#160; When that element is selected the windows on the right indicate the call tree that both precedes and succeeds that particular method.&#160;&#160; The number that is at the top of the successors window indicates the sum total of samples for this method and all of the methods that succeed it in the hierarchy.&#160; For each branch in the tree the percentage of successor samples is tallied so that you can see a break down of where the actual CPU is going.</p>  <p>Working your way down the tree as I have done on the right hand side indicates how much time is spent doing which type of work.&#160;&#160; In this case there is a mix of regular web traffic and web services traffic.&#160;&#160; From this profile it is easy to see the distribution during this run.&#160;&#160;&#160; </p>  <p><strong>&lt;click on this image to get a readable version in a new window&gt;</strong></p>  <p><a href="http://blogs.oracle.com/WLSPERFORMANCE/WindowsLiveWriter/BasicsofusingJRAwithWLS_DF63/mission_control_methods_2.png" target="_blank"><img title="mission_control_methods" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="484" alt="mission_control_methods" src="http://blogs.oracle.com/WLSPERFORMANCE/WindowsLiveWriter/BasicsofusingJRAwithWLS_DF63/mission_control_methods_thumb.png" width="622" border="0" /></a>&#160;</p>  <p>The key to using a tool like this is that you are doing sampling, so it really only makes sense to do this in cases where you can get a big enough statistical sample set.&#160; Trying to use this to analyze one particular scenario that you drive from a web browser is not appropriate.&#160;&#160;&#160; For such cases you will want to use a different tool that actually tracks every call.&#160;&#160; When you are trying to analyze a real production deployment or you want to get some insight into what is going on when your system is under heavy stress,&#160; this is the approach to use.</p>  <p>Well…. I could probably go on for ever about this scenario, but that is about enough for now.&#160; Let me know if you get a chance to try this out and if you find it useful.&#160; I’ll try to provide some interesting examples of what I learn using this approach in subsequent postings.&#160; In the meantime there is lots of good documentation on how to use JRA and I’ll be glad to answer any questions that you come up with…</p>]]>
      
   </content>
</entry>

</feed>
