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

■
Request Timeout
■
Buer Length
Thread Count
The Thread Count parameter species the maximum number of simultaneous requests the
server can handle. The default value is 5. When the server has reached the limit or request
threads, it defers processing new requests until the number of active requests drops below the
maximum amount. Increasing this value will reduce HTTP response latency times.
In practice, clients frequently connect to the server and then do not complete their requests. In
these cases, the server waits a length of time specied by the Request Timeout parameter.
Also, some sites do heavyweight transactions that take minutes to complete. Both of these
factors add to the maximum simultaneous requests that are required. If your site is processing
many requests that take many seconds, you might need to increase the number of maximum
simultaneous requests.
Adjust the thread count value based on your load and the length of time for an average request.
In general, increase this number if you have idle CPU time and requests that are pending;
decrease it if the CPU becomes overloaded. If you have many HTTP 1.0 clients (or HTTP 1.1
clients that disconnect frequently), adjust the timeout value to reduce the time a connection is
kept open.
Suitable Request Thread Count values range from 100 to 500, depending on the load. If your
system has extra CPU cycles, keep incrementally increasing thread count and monitor
performance after each incremental increase. When performance saturates (stops improving),
then stop increasing thread count.
Initial Thread Count
The Initial Thread Count property species the minimum number of threads the server
initiates upon start-up. The default value is 2. Initial Thread Count represents a hard limit for
the maximum number of active threads that can run simultaneously, which can become a
bottleneck for performance.
Request Timeout
The Request Timeout property species the number of seconds the server waits between
accepting a connection to a client and receiving information from it. The default setting is 30
seconds. Under most circumstances, changing this setting is unnecessary. By setting it to less
than the default 30 seconds, it is possible to free up threads sooner. However, disconnecting
users with slower connections also helps.
HTTP Service Settings
Chapter 3 • Tuning the Enterprise Server 65










