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

■
“Timeout Settings” on page 78
■
“Isolation Level Settings” on page 79
■
“Connection Validation Settings” on page 79
Pool Size Settings
The following settings control the size of the connection pool:
Initial and
Mimimum Pool
Size
Size of the pool when created, and its minimum allowable size.
Maximum Pool
Size
Upper limit of size of the pool.
Pool Resize
Quantity
Number of connections to be removed when the idle timeout expires. Connections that have idled for
longer than the timeout are candidates for removal. When the pool size reaches the initial and minimum
pool size, removal of connections stops.
The following table summarizes pros and cons to consider when sizing connection pools.
TABLE 3–4 Connection Pool Sizing
Connection pool Pros Cons
Small Connection pool Faster access on the connection table. May not have enough connections to
satisfy requests.
Requests may spend more time in the
queue.
Large Connection pool More connections to fulll requests.
Requests will spend less (or no) time in the
queue
Slower access on the connection table.
Timeout Settings
There are two timeout settings:
■
Max Wait Time: Amount of time the caller (the code requesting a connection) will wait
before getting a connection timeout. The default is 60 seconds. A value of zero forces caller
to wait indenitely.
To improve performance set Max Wait Time to zero (0). This essentially blocks the caller
thread until a connection becomes available. Also, this allows the server to alleviate the task
of tracking the elapsed wait time for each request and increases performance.
Initial and Mimimum Pool Size
Sun GlassFish Enterprise Server 2.1 Performance Tuning Guide • January 200978










