Object Request Broker tuning guidelines

 

+

Search Tips   |   Advanced Search

 

Use the guidelines in this document any time the Object Request Broker (ORB) is used in a workload.

The ORB is used whenever enterprise beans are accessed through a remote interface. If you experience particularly high or low CPU consumption, you might have a problem with the value of one of the following parameters. Examine these core tuning parameters for every application deployment.

ORB Thread pool

Avoid suspending threads because they have no work ready to process. If threads do not have work ready to process, CPU time is consumed by calling the Object.wait method, performing a context switch. Tune the thread pool size so that threads are not waiting long enough to get destroyed from remaining idle too long.

The thread pool size is dependent on your workload and system. In typical configurations, applications need 10 or fewer threads per processor.

Slow responses on DB backend requests can indicate a lack of available ORB server threads for servicing requests. Symptoms of this include...

  • CPU usage is low and increasing the load does not increase usage or throughput.
  • Thread dumps (tcpdump) indicates that nearly all the threads are in a call out to the backend resource.

Increase the number of threads per processor until throughput improves and thread dumps show that the threads are in other areas of the run time besides the backend call.

We can adjust the thread pool size settings in the administrative console. Click...

Servers | Application servers | servername | Container services | ORB service | Thread pool

The Allow thread allocation beyond maximum thread size parameter also affects thread pool size, but do not use this parameter unless your back end stops for long periods of time, causing the blocking of all the run-time threads waiting for the backend system instead of processing other work that does not involve the backend system.

Pass by reference

Specifies how the ORB passes parameters. If enabled, the ORB passes parameters by reference instead of by value, to avoid making an object copy. If you do not enable the pass by reference option, a copy of the parameter passes rather than the parameter object itself. This can be expensive because the ORB must first make a copy of each parameter object.

If the EJB client and server are installed in the same WAS instance, and the client and server use remote interfaces, enabling the pass by reference option can improve performance up to 50%. The pass by reference option helps performance only where non-primitive object types are passed as parameters. Therefore, int and floats are always copied, regardless of the call model.

CAUTION: Enable this property with caution because unexpected behavior can occur. If an object reference is modified by the callee, the caller's object is modified as well, since they are the same object.

If you use command-line scripting, the full name of this system property is com.ibm.CORBA.iiop.noLocalCopies.

Data type Boolean
Default Not enabled (false)

The use of this option for enterprise beans with remote interfaces violates EJB Specification, V2.0 (see section 5.4). Object references passed to EJB methods or to EJB home methods are not copied and can be subject to corruption.

Consider the following example

Iterator iterator = collection.iterator();
MyPrimaryKey pk = new MyPrimaryKey();
while (iterator.hasNext()) {
   pk.id = (String) iterator.next();
   MyEJB myEJB = myEJBHome.findByPrimaryKey(pk);
}

In this example, a reference to the same MyPrimaryKey object passes into WebSphere Application Server with a different ID value each time. Running this code with pass by reference enabled causes a problem within the application server because multiple enterprise beans are referencing the same MyPrimaryKey object. To avoid this problem, set the com.ibm.websphere.ejbcontainer.allowPrimaryKeyMutation system property to true when the pass by reference option is enabled. Setting the pass by reference option to true causes the EJB container to make a local copy of the PrimaryKey object. As a result, however, a small portion of the performance advantage of setting the pass by reference option is lost.

As a general rule, any application code that passes an object reference as a parameter to an enterprise bean method or to an EJB home method must be scrutinized to determine if passing that object reference results in loss of data integrity or in other problems.

After examining your code, one can enable the pass by reference option by setting the com.ibm.CORBA.iiop.noLocalCopies system property to true.

We can also enable the pass by reference option in the administrative console.

Click...

Servers | Application servers | servername | Container services | ORB Service and select Pass by reference

Fragment size

The ORB separates messages into fragments to send over the ORB connection. One can configure this fragment size through the com.ibm.CORBA.FragmentSize parameter.

To determine and change the size of the messages that transfer over the ORB and the number of required fragments, perform the following steps:

  1. In the administrative console, enable ORB tracing in the ORB Properties page. See Object Request Broker service settings for more information.

  2. Enable ORBRas tracing from the logging and tracing page.

  3. Increase the trace file sizes because tracing can generate a lot of data.

  4. Restart the server and run at least one iteration (preferably several) of the case that you are measuring.

  5. Look at the traceable file and do a search for Fragment to follow: Yes.

    This message indicates that the ORB transmitted a fragment, but it still has at least one remaining fragment to send before the entire message arrives. A Fragment to follow: No value indicates that the particular fragment is the last in the entire message. This fragment can also be the first, if the message fit entirely into one fragment.

    If you go to the spot where Fragment to follow: Yes is located, you find a block that looks similar to the following example:

    Fragment to follow: Yes
    Message size: 4988 (0x137C)
    --  
    Request ID: 1411

    This example indicates that the amount of data in the fragment is 4988 bytes and the Request ID is 1411. If you search for all occurrences of Request ID: 1411, one can see the number of fragments that are used to send that particular message. If you add all the associated message sizes, you have the total size of the message that is being sent through the ORB.

  6. One can configure the fragment size by setting the com.ibm.CORBA.FragmentSize property.

Interceptors

Interceptors are ORB extensions that can set up the context before the ORB runs a request. For example, the context might include transactions or activity sessions to import. If the client creates a transaction, and then flows the transaction context to the server, then the server imports the transaction context onto the server request through the interceptors.

Most clients do not start transactions or activity sessions, so most systems can benefit from removing the interceptors that are not required.

To remove the interceptors, manually edit the server.xml file and remove the interceptor lines that are not needed from the ORB section.


 

Related Tasks


Tuning the application serving environment