+

Search Tips   |   Advanced Search

Portlet load monitoring for WebSphere Portal


Portlet load monitoring, new with v8.0, allows administrators to set...

  1. Allowed number of concurrent requests
  2. Allowed average response time

If a portlet exceeds either the defined maximum number of concurrent requests, or the average response time, then Portlet Load Monitoring no longer allows further requests by the portlet. Instead, the portal renders the portlet as unavailable, and the portlet code is no longer called for further requests. This way, the portal installation is protected from non-responsive portlets consuming an increasing number of threads. For example, if set to 50, average response time is calculated from the latest 50 requests that this portlet served. These settings apply to all portlets that Portlet load monitoring monitors.


Portlet preferences configuration and administration

We can set the following parameters for individual portlets in portlet.xml before deploying or later using the Manage Portlets portlet.

We can also perform the following administrative tasks on individual portlets using the Manage Portlets portlet only:


Configure Portlet load monitoring

Add the following properties to resource environment provider WP ConfigService. These parameters affect all parameters in the portal:


Portlet configuration

Configure these portlet preferences using portlet.xml before deploying the portlet or after the deployment using the Manage Portlets portlet.


Administer Portlet load monitoring

We can administer Portlet load monitoring and the portlets that it monitors. We can determine whether and in which cases Portlet load monitoring blocks or reenables a portlet by setting its portlet preferences. We can also check which portlets Portlet load monitoring monitors, and we can manually block or activate these portlets.

For example, we can reenable a portlet after Portlet load monitoring has blocked it.


Administer portlet preferences for Portlet load monitoring

We can set portlet preferences to influence in which cases Portlet load monitoring blocks or reenables JSR portlets.

Configure parameters for the following:

To set these parameters...

  1. Log in to the portal using a portal administrator user ID.

  2. Select...

      Administration | Portlet Management | Portlets | portlet | Configure Portlet icon

  3. Add a new portlet preference as required and type number for the new portlet preference as required:

    • To set the maximum number of requests to allow for this portlet, add...

        com.ibm.wps.pe.plm.maxrequest = xyz

      For example, to allow this portlet no more than 15 concurring requests, specify...

        com.ibm.wps.pe.plm.maxrequest = 15

    • To set the reactivation limit for this portlet, add...

        com.ibm.wps.pe.plm.minrequest = xyz

      For example, if you want this portlet to be reenabled when its concurrent requests fall back to 5 or less, specify...

        com.ibm.wps.pe.plm.minrequest = 5

    • To set the allowed average response time for this portlet, add...

        com.ibm.wps.pe.plm.average.time.processing = xyz

      ...where xyz is the average response time in milliseconds.

      For example, if we specify...

        com.ibm.wps.pe.plm.average.time.processing = 3000

      ...and the average response time for this portlet exceeds 3 seconds, then Portlet load monitoring blocks further requests to this portlet.

  4. Click the Add button to add the preference.

  5. Save the changes by clicking the OK button.

As an alternative, we can define a portlet preference before deploying the portlet. In this case add the portlet preference to the portlet.xml deployment descriptors of the WAR file.


Administer portlets for Portlet load monitoring

We can administer the portlets that Portlet load monitoring monitors. We can check which portlets Portlet load monitoring monitors, and we can manually block or activate these portlets.

For example, we can reenable a portlet after Portlet load monitoring has blocked it.

To do this, we use the Manage Portlets portlet. Proceed by the following steps:

  1. Log in to the portal using a portal administrator user ID.

  2. Select...

      Administration | | Portlet Management | Portlets | portlet

  3. Administer the portlet as required:

    • For each portlet that is monitored by Portlet load monitoring, the Manage Portlets portlet displays an icon for disabling or enabline that portlet.

    • If a portlet that is monitored by Portlet load monitoring is currently active, the list shows an icon for disabline that portlet. If you click this icon, the portlet is blocked by Portlet load monitoring and is no longer rendered in the portal.

    • If a portlet that is monitored by Portlet load monitoring is currently blocked and inactive, the list shows an icon for enabline that portlet. If you click this icon, the portlet is enabled for rendering again.

      1. If the portlet was blocked for exceeding the maximum number of concurrent requests and the number of requests did not decrease and you did not set the value for maximum number of requests to a higher value, clicking this icon has no effect. In this case, the portlet is blocked again with the next request that arrives for this portlet.

      2. Activating a blocked portlet clears the response times stored for this portlet.


Log and audit events

Portlet load monitoring allows us to log events.

For example, this can help you audit events. When Portlet load monitoring blocks or enables a portlet, it creates a log file entry in the WebSphere Portal log file SystemOut.log . This log file entry contains the portlet object ID, the portlet name, the WAR file name of the portlet and the EAR file display name. The log file entries consist of translated messages. If we use tools that monitor log files for events, we can check for log file entries related to Portlet load monitoring as described in the following.

Portlet load monitoring creates log file entries for the events described in the following.

In the log entry, the variables Object_ID, Portlet_Name, War_File_Name, EAR_File_Dislay_Name, admin_user_ID are substituted with the corresponding values for the affected portlet and the administrative user.

Example: If Portlet load monitoring blocks a portlet with the portlet name StdWorldClock because the portlet exceeded the maximum number of requests allowed, then the log file entry might look like this:


API for accessing Portlet load monitoring data

Portlet load monitoring provides an API for accessing the monitoring data. We can use this API to write custom code to access that data.


Portlet load metrics interface

The PortletLoadMetrics object is defined in the package...

It contains metrics data for one specific PortletDefinition. The interface looks as follows:

package com.ibm.portal.plm;

/*
 *  This interface provides access to portlet metrics stored for Portlet Load Monitoring.
 */
public interface PortletLoadMetrics {

 /*
  * Returns true if the portlet is enabled for rendering (either by admin or by PLM).
  * If the portlet is disabled for rendering, this method returns false.
  * 
  * @return boolean true if the portlet is enabled either by admin or by PLM.
  */
 public abstract boolean isPortletEnabled();

 /*
  * Checks if the Portlet is currently enabled for rendering due to PLM constraints.
  * If PLM disabled the portlet for rendering, this method returns false.
  * 
  * @return boolean true if the Portlet is enabled for rendering, 
                     false if the Portlet is disabled for rendering.
  */
 public abstract boolean isPortletEnabledByPLM();

 /*
  * Returns true if the portlet is manually enabled by the portal administrator.
  * If the portal administrator disabled the portlet for rendering, this method returns false.
  * 
  * @return boolean true if the portlet is enabled for rendering by the portal administrator.
  */
 public abstract boolean isPortletEnabledByAdmin();
 
 /*
  * Returns the number of requests this portlet currently serves.
  * 
  * @return int number of requests this portlet currently serves.
  */
 public abstract int getCurrentNumberOfRequests();

 /*
  * Calculates the average response time for requests of this portlet in milliseconds.
  * 
  * @return int average response time of the portlet in milliseconds.
  */
 public abstract int getAverageResponseTime();


Portlet load metrics service

The isPortletLoadMetricsService is contained in the package com.ibm.portal.plm.service.PortletLoadMetricsService. We can use this service to access PortletLoadMetrics objects. It also allows us to query general Portlet load monitoring related information. To obtain the PortletLoadMetricsService, you have to perform a JNDI lookup in the following way:

     PortletLoadMetricsEnabled(ObjectID portletID) plm;
      javax.naming.Context ctx = new javax.naming.InitialContext();
      try {
           plm = (PortletLoadMetricsService 
              ctx.lookup(PortletLoadMetricsService.JNDI_NAME);
      } catch(javax.naming.NameNotFoundException ex) {
           ... error handling ...
      }
Once you successfully obtained the PortletLoadMetricsService, we can use methods as defined in the PortletLoadMetrics interface:
public interface PortletLoadMetricsService {

 String JNDI_NAME = "portal:service/plm/PortletLoadMetrics";
 
 /**
  * Determines if PLM is enabled for a given portlet. 
  * 
  * @param portletID ObjectID of the portlet.
  * @return true If PLM is enable for a given portlet.
  *      false If PLM is not enabled for a given portlet or if portlet does not exist.
  */
 boolean isPortletLoadMetricsEnabled(ObjectID portletID); 

 /**
  * Returns a PortletLoadMetrics object for the portlet. 
  * Creates the PortletLoadMetrics if PLM is enabled for this portlet and   * it the PortletLoadMetrics object does not yet exist.
  * 
  * @param portletID ObjectID of the portlet.
  * @return Reference to a PortletLoadMetrics object.
  *      Null if PLM is not enabled for the specified portlet.
  */
 PortletLoadMetrics getPortletLoadMetrics(ObjectID portletID);
 
 /**
  * Returns a String object containing the portlet preference value set for maximum concurrent 
  * requests allowed for this portlet.
  * 
  * @param portletID ObjectID of the portlet.
  * @return String containing the portlet preference value set for maximum concurrent 
  *         requests allowed for this portlet. Returns "null" if the portlet did not set the  
  *         portlet preference for maximum concurrent requests.
  */
 String getMaximumRequestPreferenceValue(ObjectID portletID);
 
 /**
  * Returns a String object containing the portlet preference value set for the 
  * reactivation limit for this portlet (PLM self-healing)
  * 
  * @param portletID ObjectID of the portlet.
  * @return String containing the portlet preference value set for the reactivation 
  *         limit for this portlet (PLM self-healing). Returns "null" if the portlet 
  *         did not set the portlet preference for the reactivation limit.
  */
 String getMinimumRequestPreferenceValue(ObjectID portletID);
 
 /**
  * Returns a String object containing the portlet preference value set for allowed average 
  * response time for this portlet   * 
  * @param portletID ObjectID of the portlet.
  * @return String containing the portlet preference value set for allowed average 
  *         response time for this portlet. Returns "null" if the portlet 
  *         did not set the portlet preference for allowed average response time.
  */
 String getAverageResponseTimePreferenceValue(ObjectID portletID);
 
 /**
  * Returns a Map containing all PortletLoadMetrics objects.
  * 
  * @return Map<ObjectID, PortletLoadMetrics> containig all PortletLoadMetrics objects.
  *         Key of the Map is the ObjectID of the PortletDefinition. 
  *         The value of the Map is the PortletLoadMetrics object of the PortletDefinition.
  */
 Map<ObjectID, PortletLoadMetrics> getAllPortletLoadMetricsObjects();

}


Parent: Monitoring
Related: Administer Portlet load monitoring
Administer Portlet load monitoring
Log and audit events
Configure Portlet load monitoring
Administer portlet preferences for Portlet load monitoring
API for accessing Portlet load monitoring data