JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle GlassFish Server 3.1 Performance Tuning Guide
search filter icon
search icon

Document Information

Preface

1.  Overview of GlassFish Server Performance Tuning

2.  Tuning Your Application

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

5.  Tuning the Operating System and Platform

Index

Resource Settings

Tuning JDBC and connector resources can significantly improve GlassFish Server performance.

The following topics are addressed here:

JDBC Connection Pool Settings

For optimum performance of database-intensive applications, tune the JDBC Connection Pools managed by the GlassFish Server. These connection pools maintain numerous live database connections that can be reused to reduce the overhead of opening and closing database connections. This section describes how to tune JDBC Connection Pools to improve performance.

J2EE applications use JDBC Resources to obtain connections that are maintained by the JDBC Connection Pool. More than one JDBC Resource is allowed to refer to the same JDBC Connection Pool. In such a case, the physical connection pool is shared by all the resources.

Refer to Chapter 12, Administering Database Connectivity, in Oracle GlassFish Server 3.1 Administration Guide for more information about managing JDBC connection pools.

The following topics are addressed here:

Monitoring JDBC Connection Pools

Statistics-gathering is disabled by default for JDBC Connection Pools. Refer to for instructions on enabling JDBC monitoringChapter 8, Administering the Monitoring Service, in Oracle GlassFish Server 3.1 Administration Guide. If using the Administration Console, JDBC monitoring can be enabled on the Configurations->configuration-name->Monitoring page.

The following attributes are monitored:

To get JDBC monitoring statistics, use the following commands:

asadmin get --monitor=true 
serverInstance.resources.jdbc-connection-pool.*asadmin get 
--monitor=true serverInstance.resources.jdbc-connection-pool. poolName.* *

To view JDBC monitoring statistics through the Administration Console, navigate to the server (Admin Server) page and click the Monitor tab. Refer to the Administration Console online help for complete instructions.

Tuning JDBC Connection Pools

Refer to Chapter 12, Administering Database Connectivity, in Oracle GlassFish Server 3.1 Administration Guide for instructions on configuring JDBC connection pools. If using the GlassFish Server Administration Console by navigating to the Resources->JDBC->JDBC Connection Pools->jdbc-pool-name page and then clicking the desired tab.

The following JDBC properites affect GlassFish Server performance:

Pool Size Settings

Pool Size settings can be configured in the Pool Settings section on the General tab in the Edit JDBC Connection Pool page.

The following settings control the size of the connection pool:

The following table summarizes advantages and disadvantages to consider when sizing connection pools.

Table 3-4 Connection Pool Sizing

Connection Pool
Advantages
Disadvantages
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 fulfill requests.

Requests will spend less (or no) time in the queue

Slower access on the connection table.
Timeout Settings

The following JDBC timeout settings can be configured on the in the Pool Settings section on the General tab in the Edit JDBC Connection Pool page.

Isolation Level Settings

The following JDBC Isolation Level settings can be configured in the Transaction section on the General tab in the Edit JDBC Connection Pool page.

Avoid specifying the Transaction Isolation level. If that is not possible, consider disabling the Isolation Level Guaranteed option and then make sure applications do not programmatically alter the connections; isolation level.

If you must specify a Transaction Isolation level, specify the best-performing level possible. The isolation levels listed from best performance to worst are:

  1. READ_UNCOMMITTED

  2. READ_COMMITTED

  3. REPEATABLE_READ

  4. SERIALIZABLE

Choose the isolation level that provides the best performance, yet still meets the concurrency and consistency needs of the application.

Connection Validation Settings

JDBC Connection Validation settings can be configured in the Connection Validation section on the Advanced tab in the Edit JDBC Connection Pool page.

Connector Connection Pool Settings

From a performance standpoint, connector connection pools are similar to JDBC connection pools. Follow all the recommendations in the previous section, Tuning JDBC Connection Pools.

Transaction Support

You may be able to improve performance by overriding the default transaction support specified for each connector connection pool.

For example, consider a case where an Enterprise Information System (EIS) has a connection factory that supports local transactions with better performance than global transactions. If a resource from this EIS needs to be mixed with a resource coming from another resource manager, the default behavior forces the use of XA transactions, leading to lower performance. However, by changing the EIS’s connector connection pool to use LocalTransaction transaction support and leveraging the Last Agent Optimization feature previously described, you could leverage the better-performing EIS LocalTransaction implementation. For more information on LAO, see Configure JDBC Resources as One-Phase Commit Resources

You can specify transaction support when you create or edit a connector connection pool.

Also set transaction support using asadmin. For example, the following asadmin command could be used to create a connector connection pool TESTPOOL with transaction-support set to LOCAL.

asadmin> create-connector-connection-pool --raname jdbcra 
--connectiondefinition javax.sql.DataSource 
-transactionsupport LocalTransaction 
TESTPOOL