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

4.  Tuning the Java Runtime System

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

Server Scaling

This section provides recommendations for optimal performance scaling server for the following server subsystems:

Processors

The GlassFish Server automatically takes advantage of multiple CPUs. In general, the effectiveness of multiple CPUs varies with the operating system and the workload, but more processors will generally improve dynamic content performance.

Static content involves mostly input/output (I/O) rather than CPU activity. If the server is tuned properly, increasing primary memory will increase its content caching and thus increase the relative amount of time it spends in I/O versus CPU activity. Studies have shown that doubling the number of CPUs increases servlet performance by 50 to 80 percent.

Memory

See the section Hardware and Software Requirements in the GlassFish Server Release Notes for specific memory recommendations for each supported operating system.

Disk Space

It is best to have enough disk space for the OS, document tree, and log files. In most cases 2GB total is sufficient.

Put the OS, swap/paging file, GlassFish Server logs, and document tree each on separate hard drives. This way, if the log files fill up the log drive, the OS does not suffer. Also, its easy to tell if the OS paging file is causing drive activity, for example.

OS vendors generally provide specific recommendations for how much swap or paging space to allocate. Based on Oracle testing, GlassFish Server performs best with swap space equal to RAM, plus enough to map the document tree.

Networking

To determine the bandwidth the application needs, determine the following values:

Then, the bandwidth required is:

Npeakr / t

For example, to support a peak of 50 users with an average document size of 24 Kbytes, and transferring each document in an average of 5 seconds, requires 240 Kbytes (1920 Kbit/s). So the site needs two T1 lines (each 1544 Kbit/s). This bandwidth also allows some overhead for growth.

The server’s network interface card must support more than the WAN to which it is connected. For example, if you have up to three T1 lines, you can get by with a 10BaseT interface. Up to a T3 line (45 Mbit/s), you can use 100BaseT. But if you have more than 50 Mbit/s of WAN bandwidth, consider configuring multiple 100BaseT interfaces, or look at Gigabit Ethernet technology.

UDP Buffer Sizes

GlassFish Server uses User Datagram Protocol (UDP) for the transmission of multicast messages to GlassFish Server instances in a cluster. For peak performance from a GlassFish Server cluster that uses UDP multicast, limit the need to retransmit UDP messages. To limit the need to retransmit UDP messages, set the size of the UDP buffer to avoid excessive UDP datagram loss.

To Determine an Optimal UDP Buffer Size

The size of UDP buffer that is required to prevent excessive UDP datagram loss depends on many factors, such as:

If only one instance is running on each host in your cluster, the default UDP buffer size should suffice. If several instances are running on each host, determine whether the UDP buffer is large enough by testing for the loss of UDP packets.


Note - On Linux systems, the default UDP buffer size might be insufficient even if only one instance is running on each host. In this situation, set the UDP buffer size as explained in To Set the UDP Buffer Size on Linux Systems.


  1. Ensure that no GlassFish Server clusters are running.

    If necessary, stop any running clusters as explained in To Stop a Cluster in Oracle GlassFish Server 3.1-3.1.1 High Availability Administration Guide.

  2. Determine the absolute number of lost UDP packets when no clusters are running.

    How you determine the number of lost packets depends on the operating system. For example:

    • On Linux systems, use the netstat -su command and look for the packet receive errors count in the Udp section.

    • On AIX systems, use the netstat -s command and look for the fragments dropped (dup or out of space) count in the ip section.

  3. Start all the clusters that are configured for your installation of GlassFish Server.

    Start each cluster as explained in To Start a Cluster in Oracle GlassFish Server 3.1-3.1.1 High Availability Administration Guide.

  4. Determine the absolute number of lost UDP packets after the clusters are started.
  5. If the difference in the number of lost packets is significant, increase the size of the UDP buffer.

To Set the UDP Buffer Size on Linux Systems

On Linux systems, a default UDP buffer size is set for the client, but not for the server. Therefore, on Linux systems, the UDP buffer size might have to be increased. Setting the UDP buffer size involves setting the following kernel parameters:

Example 5-1 Setting the UDP Buffer Size in the /etc/sysctl.conf File

This example shows the lines in the /etc/sysctl.conf file for setting the kernel parameters for controlling the UDP buffer size to 524288.

net.core.rmem_max=524288
net.core.wmem_max=524288
net.core.rmem_default=524288
net.core.wmem_default=524288

Example 5-2 Setting the UDP Buffer Size at Runtime

This example sets the kernel parameters for controlling the UDP buffer size to 524288 at runtime.

$ /sbin/sysctl -w net.core.rmem_max=524288 \
net.core.wmem_max=52428 \
net.core.rmem_default=52428 \
net.core.wmem_default=524288
net.core.rmem_max = 524288
net.core.wmem_max = 52428
net.core.rmem_default = 52428
net.core.wmem_default = 524288