Skip Navigation Links
Oracle GlassFish Server 3.1 Performance Tuning Guide
Search Scope:
This Document
Entire Library
Oracle GlassFish Server 3.1 Performance Tuning Guide
July 2011
The Performance Tuning Guide describes how to get the best performance with GlassFish Server 3.1.
Document Information
Preface
1. Overview of GlassFish Server Performance Tuning
Process Overview
Performance Tuning Sequence
Understanding Operational Requirements
Application Architecture
Security Requirements
User Authentication and Authorization
Encryption
High Availability Clustering, Load Balancing, and Failover
Hardware Resources
Administration
General Tuning Concepts
Capacity Planning
To Determine Capacity
User Expectations
Further Information
2. Tuning Your Application
Java Programming Guidelines
Avoid Serialization and Deserialization
Use
StringBuilder
to Concatenate Strings
Assign null to Variables That Are No Longer Needed
Declare Methods as final Only If Necessary
Declare Constants as static final
Avoid Finalizers
Declare Method Arguments final
Synchronize Only When Necessary
Use DataHandlers for SOAP Attachments
Java Server Page and Servlet Tuning
Suggested Coding Practices
General Guidelines
Avoid Shared Modified Class Variables
HTTP Session Handling
Configuration and Deployment Tips
Optimize SSL
Disable Security Manager
EJB Performance Tuning
Goals
Monitoring EJB Components
Monitoring Individual EJB Components
General Guidelines
Use High Performance Beans
Use Caching
Use the Appropriate Stubs
Remove Unneeded Stateful Session Beans
Cache and Pool Tuning Tips
Using Local and Remote Interfaces
Prefer Local Interfaces
Using Pass-By-Reference Semantics
Improving Performance of EJB Transactions
Use Container-Managed Transactions
Do Not 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
Version Consistency
Request Partitioning
Tuning Tips for Specific Types of EJB Components
Entity Beans
Stateful Session Beans
Checkpoint only when needed
Stateless Session Beans
Read-Only Entity Beans
Refresh Period
Pre-Fetching Container Managed Relationship (CMR) Beans
JDBC and Database Access
Use JDBC Directly
Encapsulate Business Logic in Entity EJB Components
Close Connections
Minimize the Database Transaction Isolation Level
Tuning Message-Driven Beans
Use
getConnection()
Tune the Message-Driven Bean's Pool Size
Cache Bean-Specific Resources
Limit Use of JMS Connections
3. Tuning the GlassFish Server
Using the GlassFish Server Performance Tuner
Deployment Settings
Disable Auto-Deployment
Use Pre-compiled JavaServer Pages
Disable Dynamic Application Reloading
Logger Settings
General Settings
Log Levels
Web Container Settings
Session Properties: Session Timeout
Manager Properties: Reap Interval
Disable Dynamic JSP Reloading
EJB Container Settings
Monitoring the EJB Container
Tuning the EJB Container
Overview of EJB Pooling and Caching
Tuning the EJB Pool
EJB Pool Settings
Tuning the EJB Cache
EJB Cache Settings
Pool and Cache Settings for Individual EJB Components
Commit Option
Determining the Best Commit Option
Java Message Service Settings
Transaction Service Settings
Monitoring the Transaction Service
Viewing Monitoring Information
Tuning the Transaction Service
Disable Distributed Transaction Logging
Recover On Restart (Automatic Recovery)
Keypoint Interval
HTTP Service Settings
Monitoring the HTTP Service
DNS Cache Information (dns)
Enabled
CacheEntries (CurrentCacheEntries / MaxCacheEntries)
HitRatio
Caching DNS Entries
Limit DNS Lookups to Asynchronous
Enabled
NameLookups
AddrLookups
LookupsInProgress
File Cache Information (file-cache)
Keep Alive (keep-alive)
Connection Queue
HTTP Service Access Logging
Network Listener Settings
General Settings
HTTP Settings
Max Connections
DNS Lookup Enabled
Timeout
Header Buffer Length
File Cache Settings
Max File Count
Max Age
Transport Settings
Thread Pool Settings
Max Thread Pool Size
Min Thread Pool Size
ORB Settings
Overview
How a Client Connects to the ORB
Monitoring the ORB
Connection Statistics
Thread Pools
Tuning the ORB
Tunable ORB Parameters
ORB Thread Pool Parameters
Client ORB Properties
Controlling Connections Between Client and Server ORB
Load Balancing
Thread Pool Sizing
Examining IIOP Messages
Resource Settings
JDBC Connection Pool Settings
Monitoring JDBC Connection Pools
Tuning JDBC Connection Pools
Pool Size Settings
Timeout Settings
Isolation Level Settings
Connection Validation Settings
Connector Connection Pool Settings
Transaction Support
Load Balancer Settings
4. Tuning the Java Runtime System
Java Virtual Machine Settings
Start Options
Tuning High Availability Persistence
Managing Memory and Garbage Collection
Tuning the Garbage Collector
Choosing the Garbage Collection Algorithm
Additional Information
Tracing Garbage Collection
Other Garbage Collector Settings
Setting the Maximum Permanent Generation
Disabling Explicit Garbage Collection
Setting the Frequency of Full Garbage Collection
Tuning the Java Heap
Guidelines for Java Heap Sizing
Heap Tuning Parameters
Survivor Ratio Sizing
Rebasing DLLs on Windows
To rebase the GlassFish Server's DLLs
Further Information
5. Tuning the Operating System and Platform
Server Scaling
Processors
Memory
Disk Space
Networking
UDP Buffer Sizes
To Determine an Optimal UDP Buffer Size
To Set the UDP Buffer Size on Linux Systems
Solaris 10 Platform-Specific Tuning Information
Tuning for the Solaris OS
Tuning Parameters
Sizing the Connection Hash Table
File Descriptor Setting
Tuning for Solaris on x86
File Descriptors
IP Stack Settings
Tuning for Linux platforms
Startup Files
File Descriptors
Virtual Memory
Network Interface
Disk I/O Settings
To tune disk I/O performance for non SCSI disks
TCP/IP Settings
To tune the TCP/IP settings
Tuning UltraSPARC CMT-Based Systems
Tuning Operating System and TCP Settings
Disk Configuration
Network Configuration
Index
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
R
S
T
U
V
W
X