Load Balancing
For information on how to congure RMI/IIOP for multiple application server instances in a
cluster,
Chapter 9, “RMI-IIOP Load Balancing and Failover,” in Sun GlassFish Enterprise
Server 2.1 High Availability Administration Guide
.
When tuning the client ORB for load-balancing and connections, consider the number of
connections opened on the server ORB. Start from a low number of connections and then
increase it to observe any performance benets. A connection to the server translates to an ORB
thread reading actively from the connection (these threads are not pooled, but exist currently
for the lifetime of the connection).
Thread Pool Sizing
After examining the number of inbound and outbound connections as explained above, tune
the size of the thread pool appropriately. This can aect performance and response times
signicantly.
The size computation takes into account the number of client requests to be processed
concurrently, the resource (number of CPUs and amount of memory) available on the machine
and the response times required for processing the client requests.
Setting the size to a very small value can aect the ability of the server to process requests
concurrently, thus aecting the response times since requests will sit longer in the task queue.
On the other hand, having a large number of worker threads to service requests can also be
detrimental because they consume system resources, which increases concurrency. This can
mean that threads take longer to acquire shared structures in the EJB container, thus aecting
response times.
The worker thread pool is also used for the EJB container’shousekeeping activity such as
trimming the pools and caches. This activity needs to be accounted for also when determining
the size. Having too many ORB worker threads is detrimental for performance since the server
has to maintain all these threads. The idle threads are destroyed after the idle thread timeout
period.
Examining IIOP Messages
It is sometimes useful to examine the IIOP messages passed by the Enterprise Server. To make
the server save IIOP messages to the server.log le, set the JVM option
-Dcom.sun.CORBA.ORBDebug=giop. Use the same option on the client ORB.
The following is an example of IIOP messages saved to the server log. Note: in the actual output,
each line is preceded by the timestamp, such as [29/Aug/2002:22:41:43] INFO (27179):
CORE3282: stdout.
ORBSettings
SunGlassFishEnterpriseServer2.1PerformanceTuningGuide • January200974