Monday Feb 09, 2009

GlassFish Performance Advisor - Log Entry Alert

In this blog, I would like to talk about the "Log Entry Alert", one of the useful features of the GlassFish Performance Advisor.

The Log Entry Alert sends an email alert whenever there is an entry in the application server's log file for user-specified logger(s) at user specified level. The logger could be one of the predefined application server logger or it could be any logger that your application uses. So this feature can be particularly useful when user applications want to send out email to users or admninistrators, in certain conditions.

For example, consider the case when someone tries to login to your application and the authentication fails for a certain number of times. You may want to be alerted when this happens. Your application could log this in the application server's log file at the WARNING level in a logger of your choice, say com.xyz.mylogger. You can configure the Performance Advisor to send out an email alert when there is a log entry at WARNING level in the logger com.xyz.mylogger. And that's it!

Once you have the Performance advisor setup and running, go to the admin console and click on Management Rules->LogEntry Alert. This is the Log Entry Alert configuration screen that you will see :



Log Entry Configuration

In the above screen you specify the log level and the logger name for which you want to be alerted. You could specify multiple loggers, separating them by commas. For example, if you want to be alerted when a WARNING level entry takes place for loggers com.xyz.logger1 and com.xyz.logger2, you specify "com.xyz.logger1,com.xys.logger2" in the logger names field. If you want to be alerted for all loggers just enter "\*".

Besides that, you need to specify the email address of the recipient and other email settings. You can either use the JavaMail Resource or specify other email values to get the email going. At the bottom of the screen, you can specify the targets for which you want to set up this alert.

GlassFish Performance Advisor - Managing Rotated Log Files

In this blog, I would like to talk about setting up and using the log rotation management features of the GlassFish Performance Advisor.

The GlassFish application server allows users to configure the logger settings in such a way that the server would automatically rotate log files, when certain user-configurable conditions are met. This typically happens when the log file exceeds a certain size. Over a period of time, you could end up with a number of rotated log files. The Log Rotation Manager feature of the Performance Advisor lets you manage the rotated log files.

To set up the Log Rotation Manager, click on the Performance Advisor->Management Rules->Log Rotation Manager node on the admin console. This is how the screen to set up the Log Rotation Manager looks like :



Rotated Log Management

In the above screen you can specify whether you want to move the rotated log files to a different directory(typically, for archiving) or delete the files. The Rotation Policy can be one of the three options : Number Of Files, Size or Time. I'll explain these 3 options below.

Number Of Files : When you select this option, the Log Rotation Manager will periodically check the log directory and if the number of log files exceeds the user configured number of files, the log files are either delete or moved to a different directory. So for example, if you chose the "NumberOfFiles" rotation policy option and set the NumberOfFiles to 3, the server will move or delete rotated files, when their number exceeds 3, so there are no more than 3 rotated log files in the log directory.

Size : When you select this option, the Log Rotation Manager will periodically check the log directory and if the total size of log files exceeds the user configured size, the log files are either delete or moved to a different directory. So for example, if you chose the "Size" rotation policy option and set the Size limit to 100 MB, the server will move or delete rotated files, when their total size exceeds 100MB, so the total size of rotated log files does not exceed 100 MB.

Time : When you select this option, the Log Rotation Manager will periodically check the log directory and if there are any files older than the specified time, they are moved or deleted.

The Log Rotation Manager can be setup on any instance or cluster. From the admingui, all you need to do is select the list of targets for which you want set this rule up and the rest will be taken care of by the Performance Advisor.

GlassFish Performance Advisor - Install and setup

The recently announced "GlassFish Enterprise Manager" has a number of cool features. In this blog I will introduce one of the interesting features, called the Performance Advisor and talk about how to install it and set it up.

As the name suggests, the Performance Advisor is designed to help users improve the performance of the application server. It does so in various ways :

  • Adjust the configuration settings in domain.xml to improve performance, based on the specific installation. This is discussed in more detail in a description of the Static Tuner.
  • Monitor various user configurable aspects of the system and alert the user when a potential problem is detected. You can find some examples here.
  • Automatically configure the settings of a running server instance, based on load and performance characteristics, observed while the server is running. An example would be the JDBC Pool Configuration.

    With this brief introduction, I will talk about how to install and set up the Performance Advisor.

    The Performance Advisor is available as a patch from SunSolve, look for patch id 140751. After downloading the patch do these steps :

  • Extract PerformanceAdvisor.jar and copy it into <glassfish-install>/lib directory.
  • Restart Domain Admin Server (DAS). The Performance Advisor is now installed and ready to be configured
  • Access the Admin Console (typically at <host>:4848) from your favorite browser.

    The "Performance Advisor" node will appear in the tree in the left frame of the console. This is how it would look like :

    Performance Advisor in Admin Console

    The Performance Advisor node consists of two parts -

  • Management rules
  • Static Tuner.

    Click on the Static Tuner to configure the domain.xml based on your installation. This is how the Static Tuner screen looks like : Static Tuner

    Click on "Management Rules". You will see a number of rules that can be configured to monitor various aspects of the running instance :

    Performance Advisor in Admin Console
    You can set up the advisor rules on different instances and clusters. After setting those up, you will need to restart the instances and clusters.

  • About

    sirajg

    Search

    Categories
    Archives
    « July 2014
    SunMonTueWedThuFriSat
      
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
      
           
    Today