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

Conguration and DeploymentTips
Follow these conguration tips to improve performance. These tips are intended for production
environments, not development environments.
■
To improve class loading time, avoid having excessive directories in the server CLASSPATH.
Put application-related classes into JAR les.
■
HTTP response times are dependent on how the keep-alive subsystem and the HTTP server
is tuned in general. For more information, see
“HTTP Service Settings” on page 60.
■
Cache servlet results when possible. For more information, see Chapter 8, “Developing Web
and SIP Applications,” in Sun GlassFish Enterprise Server 2.1 Developer’s Guide
.
■
If an application does not contain any EJB components, deploy the application as a WAR
le, not an EAR le.
Optimize SSL
Optimize SSL by using routines in the appropriate operating system library for concurrent
access to heap space. The library to use depends on the version of the Solaris
TM
Operating
System (SolarisOS) that you are using. To ensure that you use the correct library, set the
LD_PRELOAD environment variable to specify the correct library le. For mor information, see
the following table.
Solaris OS Version Library Setting of LD_PRELOAD EnvironmentVariable
10 libumem–3LIB /usr/lib/libumem.so
9 libmtmalloc-3LIB /usr/lib/libmtmalloc.so
To set the LD_PRELOAD environment variable, edit the entry for this environment variable in the
startserv script. The startserv script is located is located in the bin/startserv directory of
your domain.
The exact syntax to dene an environment variable depends on the shell that you are using.
Disable Security Manager
The security manager is expensive because calls to required resources must call the
doPrivileged() method and must also check the resource with the server.policy le. If you
are sure that no malicious code will be run on the server and you do not use authentication
within your application, then you can disable the security manager.
To disable use of the server.policy le, use the Admin Console. Under Congurations >
cong-name > JVM Settings (JVM Options) delete the option that contains the following text:
-Djava.security.manager
Java Server Page and ServletTuning
Chapter 2 • TuningYour Application 31










