Server User Manual
Table Of Contents
- Sun GlassFish Enterprise Server 2.1 Performance Tuning Guide
- Preface
- Overview of Enterprise Server Performance Tuning
- Tuning Your Application
- Java Programming Guidelines
- Java Server Page and Servlet Tuning
- EJB Performance Tuning
- Goals
- Monitoring EJB Components
- General Guidelines
- Using Local and Remote Interfaces
- Improving Performance of EJB Transactions
- Use Container-Managed Transactions
- Don’t Encompass User Input Time
- Identify Non-Transactional Methods
- Use TX_REQUIRED for Long Transaction Chains
- Use Lowest Cost Database Locking
- Use XA-Capable Data Sources Only When Needed
- Configure JDBC Resources as One-Phase Commit Resources
- Use the Least Expensive Transaction Attribute
- Using Special Techniques
- Tuning Tips for Specific Types of EJB Components
- JDBC and Database Access
- Tuning Message-Driven Beans
- Tuning the Enterprise Server
- Deployment Settings
- Logger Settings
- Web Container Settings
- EJB Container Settings
- Java Message Service Settings
- Transaction Service Settings
- HTTP Service Settings
- ORB Settings
- Thread Pool Settings
- Resources
- Tuning the Java Runtime System
- Tuning the Operating System and Platform
- Tuning for High-Availability
- Index

For optimal performance, use a pool with eight to 16 connections per node. For example, if you
have four nodes congured, then the steady-pool size must be set to 32 and the maximum pool
size must be 64. Adjust the Idle Timeout and Pool Resize Quantity values based on monitoring
statistics.
For the best performance, use the following settings:
■
Connection Validation: Required
■
Validation Method: metadata
■
Transaction Isolation Level: repeatable-read
In addition to the standard attributes, add the two following properties:
■
cacheDatabaseMetaData: false
■
eliminateRedundantEndTransaction: true
To add a property, click the Add Property button, then specify the property name and value,
and click Save.
For more information on conguring the JDBC connection pool, see
“Tuning JDBC
Connection Pools” on page 77
.
Conguring the Load Balancer
The Enterprise Server provides a load balancer plugin that can balance the load of requests
among multiple instances which are part of the cluster.
Note – The following section assumes that the server is tuned eectively to service incoming
requests.
Enabling the Health Checker
The load balancer periodically checks all the congured Enterprise Server instances that are
marked as unhealthy, based on the values specied in the health-checker element in the
loadbalancer.xml le. Enabling the health checker is optional. If the health checker is not
enabled, periodic health check of unhealthy instances is not performed.
The load balancer’s health check mechanism communicates with the application server
instance using HTTP. The health checker sends an HTTP request to the URL specied and waits
for a response. The status code in the HTTP response header should be between 100 and 500 to
consider the instance to be healthy.
To enable the health checker, edit the following properties:
■
url: Species the listener’s URL that the load balancer checks to determine its state of health.
Conguring the Load Balancer
Sun GlassFish Enterprise Server 2.1 Performance Tuning Guide • January 2009120










