Monitoring a server

Monitoring server events and statistics may help you anticipate and prevent server problems. Statistics are available three ways, using the Management Console, the J2EE Management API, or the Jaguar::Monitoring API.

You can download the documentation for the J2EE Management API from the Sun Developer Network.

The Jaguar::Monitoring API is available as a CORBA component, but is provided only for backward compatibility. EAServer 6.0 provides limited support for the last maximum and peak maximum statistics. If 60-second statistics are enabled, the value of last maximum is the same as the 60-second maximum value. In most cases, the value of peak maximum is the same as the current value. You can enable 60-second statistics in the Management Console, on the server’s General tab—see “General tab”. The HTML documentation for the Jaguar::Monitoring API is in the html/ir subdirectory of your EAServer installation.

Memory monitoring enables EAServer to prevent low memory from causing the server to crash. Two SocketListener properties support this feature, memoryAlarmLevel and memoryCriticalLevel. memoryAlarmLevel defines the percentage of system memory that can be used before EAServer notifies users of low memory. Memory usage equal to the value of memoryCriticalLevel prevents new component invocations.

Performance monitoring looks at response times for components in the server. If you enable performance monitoring for a component, the server calculates the average time it takes to execute methods on this component. If the average time is too long (as configured by the user), EAServer blocks subsequent requests for this component. You can monitor performance at the component, listener, and server level. Listener-level monitoring takes precedence over component-level monitoring, and server-level monitoring takes precedence over both.

Component-level monitoring

To configure performance monitoring at the component level, add the performanceMonitor attribute to the configuration file for the component you want to monitor. The performanceMonitor attribute takes two parameters:

For example, if the maximumResponseTime is 2000 ms and minInstances is 10, and if the response time for this component is more than 2000 ms, EAServer allows only 10 instances of the component to run concurrently. The following is a sample EJB-JAR configuration file that sets these values for the performanceMonitor:

<setProperties    component="ejb.components.crescalator.crhandler.EscalationLocalHome"    merge="false">

   <property name="ejbName" value="Escalation"/>
   <instancePool timeout="${ejb.poolTimeout}"/>
   <permitAccess ports="${ejb.allowedPorts}"/>
   <classLoader name="ejb.components.crescalator.crhandler"/>
   <threadMonitor name="${ejb.localThreadMonitor}"/>
   <transaction type="Required" retry="${ejb.transactionRetry}"
      sqlIsolationLevel="${sql.isolationLevel}"/>
   <performanceMonitor maxResponseTime="2000" minInstances="10"/>

</setProperties>

Listener and server monitoring

To configure performance monitoring at the listener or server level, set the performanceMonitor attribute in the entity’s Ant configuration file, following the example above.

A value of -1 disables monitoring at the level it is defined. The default monitoring configuration is: