Sun GlassFish Enterprise Manager Performance Advisor 1.0 Installation and Quick Start Guide

Getting Started with the GlassFish Performance Advisor

The GlassFish Enterprise Manager Performance Advisor provides performance tuning assistance and performance alerts for Sun GlassFishTM Enterprise Server version 2.1.

This Installation and Quick Start Guide explains how to use the Performance Advisor in the following sections:

For the latest GlassFish Enterprise Manager Performance Advisor updates, see the Sun GlassFish Enterprise Manager Performance Advisor 1.0 Release Notes. See also the documentation set for Sun GlassFish Enterprise Server.

Downloading and Installing the Performance Advisor

The Performance Advisor is available for download to Sun customers with any of these entitlements:

    To download and install this component, follow these steps:

  1. Go to the SunSolve site at http://sunsolve.sun.com/.

  2. Click on the Accept button to accept the SunSolve license agreement.

  3. Click on the Login link in the right column and enter your support username and password.

  4. Click on the Patches and Updates link in the right column.

  5. Enter the Performance Advisor patch number, 140751–01, in the PatchFinder field and click on the Find Patch button.

  6. Click on the HTTP link next to Download Patch.

    A file named 140751–01.zip is copied to your machine.

  7. Unzip the 140751–01.zip file. For example:


    unzip 140751–01.zip

    The unzipped contents consist of an archive file named performance-advisor.jar and several other files.

  8. Place the performance-advisor.jar file in the as-install/lib directory, where as-install is the directory in which the Enterprise Server was installed.


    Note –

    Do not rename the performance-advisor.jar file.


  9. Restart the domain. You can use the following asadmin commands.


    asadmin stop-domain domain1
    asadmin start-domain domain1

    For more information about the asadmin stop-domain and asadmin start-domain commands, see the Sun GlassFish Enterprise Server 2.1 Reference Manual.

After successful installation, the Performance Advisor node appears in the left pane of the Admin Console. This node has two sub-nodes, Management Rules and Tuner.

Using the Performance Tuner

The Tuner recommends server settings to suit the needs of your Enterprise Server deployment. It helps you reach an optimal configuration. Finer tuning might be needed in case of specific requirements. The Tuner performs static analysis of Enterprise Server resources and throughput requirements. No dynamic inspection of the system is performed.

The Tuner accommodates both homogeneous and nonhomogeneous clusters. Homogeneity is based on the following criteria: operating system, hardware, physical memory, and cores (logical CPUs). For homogeneous clusters, all criteria match for all machines where the cluster's component instances run. For nonhomogeneous clusters, these values differ. For nonhomogeneous clusters, you should start with pessimistic values and increase these values for specific component instances that run on more powerful or resourceful hardware.

System properties change settings for individual server instances within a cluster. The Tuner sets some system properties. For more information about system properties, see the following documentation:


Note –

Before tuning a cluster, ensure that all instances are running so the tuner can gather important data for calculating the tunable settings.


    To use the Tuner, follow these steps:

  1. Select the Tuner node in the left pane of the Admin Console.

  2. Provide the requested information. If necessary, consult your system administrator.

    • Configuration to Tune — Select the name of the server or cluster from the drop-down list.

    • Number of Cores — Specify the number of logical CPUs (also known as processor threads) available per machine. The default is 1.

      You don't need to specify the total number of CPUs on the machine, only the number you want to allocate for use by each Enterprise Server instance running on it.

      On a Sun SPARC Enterprise T5440 (http://www.sun.com/servers/coolthreads/t5440/), the number of logical CPUs (or processor threads) is returned by a command such as psrinfo. A Sun SPARC Enterprise T5440 can have up to 256 processor threads. For more information, consult your hardware vendor's data sheet.

    • Maximum Heap Memory Available — Specify the size of the heap memory for the Enterprise Server's JVM server instance. The default is 1024 MB. The specified value for heap memory may not be applied if the tuner determines that it is not optimal.

    • Allocation Time for Database Access — Specify that the allocation time is Low (0% - 10%), Medium (10% - 20%), or High (>= 20%). The default is Medium.

      This is the time in the database tier spent by the primary application deployed on the instance or cluster being tuned. If you have multiple applications deployed on the cluster, this should be the sum of the time spent in the database tier by all applications. You should also take into account the time spent per web or EJB request.

    • Garbage Collection Strategy — Specify either Maximum Peak Throughput (Higher GC Pause) or Low GC Pause (Lower Peak Throughput). The default is Maximum Peak Throughput.

      This strategy determines what happens to garbage collection in the JVM. Obviously garbage collection should take minimal time, but this may not always be possible. The Enterprise Server's JVM can be configured to have many short GC pauses or a small number of relatively longer GC pauses. When a small number of GC pauses is your strategy, the throughput is generally greater, with 1 – 2% of requests experiencing latency.

    • Disable Security Manager? — Specify whether to disable the Java Platform Security Manager. Disabling the security manager may improve performance but may decrease system security. The default is Yes.

    • Disable Access Logger? — Specify whether to disable access logging. Disabling access logging may improve performance but removes some system information. The default is Yes.

    • Running on Sun's CoolThreads (Niagara) Server? — Check this box if the server instances are running on a Sun server with CoolThreadsTM technology. The default is No. For more information, see http://www.sun.com/servers/index.jsp?cat=SunCoolThreadsServers&tab=3.

  3. Select the Next button.

  4. Read the table of proposed changes carefully.

  5. If you wish to make only some of the changes, note the text in the Current Setting, Proposed Setting, and To Manually Apply columns for the changes you wish to make.

    For example, if the change adds or removes a JVM option, the option is displayed in the Current Setting or Proposed Setting column, and the following text is displayed in the To Manually Apply column:


    Go to the JVM Settings page for the configuration, select the JVM Options tab, 
    select the Add JVM Option button, and enter the JVM option. Or use one of these 
    commands: asadmin create-jvm-options or asadmin delete-jvm-options

    For more information about the asadmin commands referred to in the To Manually Apply column, see the Sun GlassFish Enterprise Server 2.1 Reference Manual.

  6. Select one of the buttons to confirm or cancel the changes.

    • To accept all the changes, select Confirm.

    • To reject all the changes, select Cancel.

  7. If you selected Cancel in step 6, manually apply any changes you found in step 5.

    For example, to remove the -Xmx512m option, use the following asadmin command. Note that the dash must be escaped with a backslash and the option must be quoted.


    asadmin delete-jvm-options "\-Xmx512m"
  8. Restart each server instance or cluster that uses the configuration you tuned.


Note –

If you add server instances to a cluster, you should retune the configuration for that cluster.


Configuring a JavaMail Resource

You can configure a JavaMailTM resource in the Enterprise Server for use in management rule notifications. This is optional; you can specify a mail server without specifying a JavaMail resource.

    To use the Admin Console, follow these steps:

  1. Open the Resources node in the left pane.

  2. Select JavaMail Sessions.

  3. Select the New button.

  4. Supply the required information:

    • JNDI Name — Specify a unique name for the JavaMail resource.

    • Mail Host — Specify the hostname of the mail server.

    • Default User — Specify the username of the mail server administrator.

    • Default Return Address — Specify the email address to which replies are sent by default.

  5. Specify the target server instances or clusters that will use the mail server. To specify a target, select the target in the Available Targets list and select the Add button to move it to the Selected Targets list.

    The JavaMail resource must have at least the same targets as the management rules that use it.

  6. Select the OK Button.

You can also use the asadmin create-javamail-resource and asadmin create-resource-ref commands. For example:


asadmin create-javamail-resource --mailhost localhost --mailuser admin 
--fromaddress admin\@company22\.com mail/MyMailSession
asadmin create-resource-ref --target Cluster1 mail/MyMailSession

For more information about the asadmin create-javamail-resource and asadmin create-resource-ref commands, see the Sun GlassFish Enterprise Server 2.1 Reference Manual.

Using the Management Rules

    Management Rules alert you to system usage issues and help you manage log files and JDBC connection pools. The general steps for configuring a management rule are as follows:

  1. Select the Management Rules node in the left pane of the Admin Console.

  2. Select the rule you wish to configure from the table.

  3. Select the Add button to display the rule's Edit page.

  4. Check the Email Notifications Enabled box if the rule has one.

    If you do not check this box, alerts are written to the server log only. All rules have this box except the Log Rotation Manager and JDBC Pool Manager.

  5. Supply the following information for email notifications.

    • Recipients — Specify the comma-separated email addresses of the recipients of the alert.

    • Use Java Mail Resource — Specify the JavaMail resource if you are using one. To set up a JavaMail resource, see Configuring a JavaMail Resource.

    • From Email — Specify the email address of the sender of the alert if you are not using a JavaMail resource.

    • Mail Hostname — Specify the same mail server hostname if you are not using a JavaMail resource.

    • Username — Specify the username of the sender of the alert if you are not using a JavaMail resource.

    • Sender Password — Specify the password or password alias of the sender of the alert if you are not using a JavaMail resource.

      To create a password alias, use the asadmin create-password-alias command. For details, see the Sun GlassFish Enterprise Server 2.1 Reference Manual.

  6. Supply the specific information that the rule requires.

    The following sections briefly describe the specific information required for each rule.

  7. Specify the target server instances or clusters to which to apply the rule. To specify a target, select the target in the Available Targets list and select the Add button to move it to the Selected Targets list.

    The JavaMail resource must have at least the same targets as the management rules that use it.

  8. Select the Save button.

  9. Restart each target server instance or cluster.

Physical Memory Alert

The Physical Memory Alert rule sends an alert when the percentage of physical memory that is free goes below a user-defined threshold.

The Physical Memory Alert rule includes the following rule-specific settings:

For general steps on how to configure a rule, see Using the Management Rules.

Memory Leak Alert

The Memory Leak Alert rule sends an alert when a possible memory leak is detected. Detection is done through trend analysis of percent memory usage after garbage collection (GC). An alert is sent when the post-GC memory usage exceeds a user-defined threshold.

The Memory Leak Alert rule includes the following rule-specific settings:

For general steps on how to configure a rule, see Using the Management Rules.

CPU Usage Trend Alert

The CPU Usage Trend Alert rule sends an alert when trend analysis of the percent CPU usage indicates an increase above a user-defined threshold.

The CPU Usage Trend Alert rule includes the following rule-specific settings:

For general steps on how to configure a rule, see Using the Management Rules.

JVM Throughput Alert

The JVM Throughput Alert rule sends an alert when the percentage of virtual machine (VM) uptime that is time-averaged elapsed GC time exceeds a user-defined threshold.

The JVM Throughput Alert rule includes the following rule-specific settings:

For general steps on how to configure a rule, see Using the Management Rules.

GC Pause Time Alert

The GC Pause Time Alert rule sends an alert when the last garbage collection (GC) pause time is above a user-specified percentage of a user-specified maximum GC pause time.

The GC Pause Time Alert rule includes the following rule-specific settings:

For general steps on how to configure a rule, see Using the Management Rules.

Log Entry Alert

The Log Entry Alert rule sends an alert when a new entry is created in the log file at or above a user-specified log level for a user-specified logger.

The Log Entry Alert rule includes the following rule-specific settings:

For general steps on how to configure a rule, see Using the Management Rules.

Log Rotation Manager

The Log Rotation Manager rule moves or deletes rotated log files.

The Log Rotation Manager rule includes the following rule-specific settings:

For general steps on how to configure a rule, see Using the Management Rules.

JDBC Pool Manager

The JDBC Pool Manager rule tunes a JDBC connection pool's values for Maximum Pool Size (max-pool-size) and for Initial and Minimum Pool Size (steady-pool-size). These recalculations happen only during runtime, and absolute recalculated values are not reflected anywhere. In production environments, recalculations are based only on the number of client requests for Initial and Minimum Pool Size, and only on server instance addition or deletion for Maximum Pool Size.

The JDBC Pool Manager rule includes the following rule-specific settings:


Note –

Do not select both * (applies to All Current and Future JDBC Connection Pools) and individual connection pools. The Max Connections setting for * (applies to All Current and Future JDBC Connection Pools) overrides the Max Connections settings for individual connection pools.



Note –

All the Max Connections settings in this rule, including Default Max Connections and the Max Connections settings for individual pools, override the Maximum Pool Size settings for the JDBC connection pools.


For general steps on how to configure a rule, see Using the Management Rules.