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

Max Files Count
Max Files Count determines how many les are in the cache. If the value is too big, the server
caches little-needed les, which wastes memory. If the value is too small, the benet of caching
is lost. Try dierent values of this attribute to nd the optimal solution for specic
applications—generally, the eects will not be great.
Hash Init Size
Hash Init Size aects memory use and search time, but rarely will have a measurable eect on
performance.
Max Age
This parameter controls how long cached information is used after a le has been cached. An
entry older than the maximum age is replaced by a new entry for the same le.
If your web site’s content changes infrequently, increase this value for improved performance.
Set the maximum age by entering or changing the value in the Maximum Age eld of the File
Cache Conguration page in the web-based Admin Console for the HTTP server node and
selecting the File Caching Tab.
Set the maximum age based on whether the content is updated (existing les are modied) on a
regular schedule or not. For example, if content is updated four times a day at regular intervals,
you could set the maximum age to 21600 seconds (6 hours). Otherwise, consider setting the
maximum age to the longest time you are willing to serve the previous version of a content le
after the le has been modied.
Small/Medium File Size and File Size Limit
The cache treats small, medium, and large les dierently. The contents of medium les are
cached by mapping the le into virtual memory (Unix/Linux platforms). The contents of small
les are cached by allocating heap space and reading the le into it. The contents of large les
are not cached, although information about large les is cached.
The advantage of distinguishing between small les and medium les is to avoid wasting part of
many pages of virtual memory when there are lots of small les. So the Small File Size Limit is
typically a slightly lower value than the VM page size.
FileTransmission
When File Transmission is enabled, the server caches open le descriptors for les in the le
cache, rather than the le contents. Also, the distinction normally made between small,
medium, and large les no longer applies since only the open le descriptor is being cached.
By default, File Transmission is enabled on Windows, and disabled on UNIX. On UNIX, only
enable File Transmission for platforms that have the requisite native OS support: HP-UX and
AIX. Don’t enable it for other UNIX/Linux platforms.
HTTP Service Settings
Sun GlassFish Enterprise Server 2.1 Performance Tuning Guide • January 200968










