Measurements and Statistics

In this section:

The Measurements package allows you to analyze the behavior of iWay Service Manager.

The Statistics package provides the following functionality:

In some situations, the Measurements package can add significant overhead to the operation of iWay Service Manager. Therefore, do not use the Measurements package in a production environment unless that environment is undergoing analysis.

The information and formats described in this topic are release-dependent, and subject to change.


Top of page

x
Show Memory

The show memory command displays the amount of memory in use at the time that the command is issued. When the Statistics package is in use, the standard display is augmented by an additional line that starts with the word Heap.

The Java Virtual Machine has a heap, which is the run-time data area from which all required memory is allocated. The heap is created at the startup of the Java Virtual Machine. Heap memory for objects is reclaimed by an automatic memory management system, which is known as a garbage collector. Although the garbage collector runs automatically, you can issue the gc command to force it to run for analytic purposes.

The heap memory display has four fields, as listed and described in the following table.

Field

Description

init

Represents the initial amount of memory (in bytes) that the Java Virtual Machine requests from the operating system for memory management during startup. The Java Virtual Machine may request additional memory from the operating system, and may also release memory to the system over time.

The value of init may be undefined (0) on some platforms.

committed

Represents the amount of memory (in bytes) that is guaranteed to be available for use by the Java Virtual Machine. The amount of committed memory may change over time (it may increase or decrease).

The Java Virtual Machine may release memory to the system, and the value of committed could be less than the value of init. The value of committed is always greater than or equal to the value of used.

max

Represents the maximum amount of memory (in bytes) that can be used for memory management. Its value may be undefined. If its value is defined, the maximum amount of memory may change over time.

If max is defined, the amount of used and committed memory is always less than or equal to the value ofmax. A memory allocation may fail if it attempts to increase the used memory, such that the value of used is greater than the value of committed, even if the value of used is less than or equal to the value of max (for example, when the system is low on virtual memory).

used

Represents the amount of memory currently used.

The heap display is more accurate than the memory display issued without the Measurements package installed. The original (standard) information is displayed, in addition to the new heap information.

Enter command:>memory
STR00X35: memory used 8244K, free 591K,
   nodes: cache 1001 allocated 8607, reclaimed 116, destroyed 116
   namespace 0 namespace reclaim 0
   Heap: init=0K committed=8244K max=65088K used=7662K
Enter command:>

The key value is used, which indicates how much memory is currently allocated. As the value of used approaches the value of max, the garbage collector may start, and performance may be eroded.


Top of page

x
Deadlocks

The deadlock detector finds cycles of threads that are in deadlock, waiting to acquire locks. Deadlocked threads are blocked, waiting to enter a synchronization block, or waiting to reenter a synchronization block after a wait call, in which each thread owns one lock while trying to obtain another lock already held by another thread.

A thread is deadlocked if it is part of a cycle in the relation is waiting for lock owned by. In the simplest case, thread A is blocked, waiting for a lock owned by thread B, and thread B is blocked, waiting for a lock owned by thread A.

This is an expensive operation. Use it only in cases in which you suspect that messages are locked up in the system.

To enable monitoring, use the command thread monitor on. To disable monitoring, use the command thread monitor off. While the monitor is enabled, entering the threads command displays information regarding deadlocks, such as the thread name or names, and the lock name or names. The thread names indicate the components that are deadlocked.


Top of page

x
Statistics

When iWay Service Manager is running without the Measurements package, some statistics are generated with wall clock times. With the Measurements package, the CPU and user state times are also generated. On the summary page, all values for time are reported in seconds, with a precision of four places. It is possible to develop a report with a greater precision for time.

In some cases, wall clock times show useful information. These times provide a measure of performance for a single message as experienced by the sender. They do not provide any information regarding the throughput capacity of iWay Service Manager.

CPU and user times describe the actual execution time expended on messages. Implementation of these measurements depends on the platform and the Java Virtual Machine (JVM). In many cases, the CPU and user times are the same, as the JVM may not discriminate between the two. For those platforms on which the JVM does discriminate, expect the CPU time to be greater than the user time.

User time is the CPU time that the current thread has executed in user mode, that is, the time spent executing iWay Service Manager instructions.

CPU time is the sum of user time and system time. It includes the time spent setting up for JVM services such as locks, network operations, I/O operations, and other services.

Enter command:>stats
       In seconds
   name      count     low    high    mean variance  std.dev. ehr num/sec
mq1a      wall:  2  0.0470  0.1560  0.1015   0.0030    0.0545   -    9.85
          cpu :  2  0.0312  0.0625  0.0469   0.0002    0.0156   -
          user:  2  0.0312  0.0625  0.0469   0.0002    0.0156   -

The stats command displays a summary of statistics gathered up to that point. To reset the values to zero, use the stats reset command. iWay recommends that you do not rely on statistics until several messages have been handled to completion, as iWay Service Manager front-loads initialization. Once the system is in a steady state, reset the statistics to zero.

The numbers displayed on the summary page are approximate and are intended for general guidance only. Brief descriptions of the displayed fields are provided in the following table. A fuller understanding of the message processing distribution described here requires some knowledge of statistics and probability, as they apply to queuing.

Field

Description

count

The number of messages that have been handled, for which statistics have been gathered.

low

The lowest time recorded for the handling of a message.

high

The highest time recorded for the handling of a message.

mean

The numeric mean of the times recorded. This value is the sum of the times divided by the number of messages handled. This value is frequently called the average.

variance

The statistical variance of the times recorded. Variance is a measure of how numbers disburse around the mean.

std.dev.

The statistical standard deviation of the times recorded. Standard deviation is a measure of how numbers disburse around the mean.

ehr

The Ehrlang Density Coefficient, which provides evidence of the randomness of the time distribution. If there are too few values to compute the coefficient, a hyphen (-) is displayed. If the coefficient is sufficiently close to constant, the term const is displayed.

This value is an approximation. A value of 1.0 indicates a Poisson distribution, which is the design point of iWay Service Manager. A very low value can indicate that the individual times recorded are skewed and therefore less usable for predicting behavior.

num/sec

The reciprocal of the mean, providing the number of messages handled per second. This value is displayed for the wall time. It is not a direct measure of the throughput capacity of iWay Service Manager.

The iWay Service Manager Administration Console also displays a summary of statistics.


Top of page

x
Emitted Statistics Information

iWay Service Manager can emit statistics as each measurement is generated. Statistics records are included in a comma-delimited file of alphanumeric characters.

The following table describes the fields in the file.

Field

Format

Description

type

String

The value 1, which is the record type. Other record types may be added in a future release.

id

String

The generator (worker) ID.

tid

String

The transaction ID.

msglen

Integer

The message length (non-streaming). If the length cannot be determined, the value -1 is specified.

complexity

Integer

A measure of the complexity of the message. The higher the number, the greater the complexity. This value is generally a measure of the number of nodes in the XML tree. A value of -1 means unknown.

For most purposes, the number of digits that this integer has is a good value to analyze.

timestamp

Integer

The current time, in milliseconds. This value is the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC (Universal Time, Coordinated). The value is a timestamp for the record.

gregtime

String

The timestamp in GMT (Greenwich Mean Time). The format is:

yyyy-mm-ddThh:mm:ss:mmmZ

walltime

Float

The wall clock time expended, in milliseconds.

usertime

Float

The user time expended, in milliseconds.

cputime

Float

The CPU time expended, in milliseconds.

usedmem

Integer

The used memory, in kilobytes (K). See Show Memory.

committed

Integer

The committed memory, in kilobytes (K). See Show Memory.

$

String

The end-of-record indicator.

The following is a sample record in the file:

1, W.udp1.1, udp1-UDP-W.udp1.1_20050328191546135Z, -1,1735, 1112037346213,
2005-03-28-T19:15:46:135Z, 78.0, 15.625, 15.625,1200,800 $ 

To enable iWay Service Manager to emit these statistics, define the following to the JVM properties

-Dstaturl=host:port

where host and port are a UDP receiver.

You can specify the host and port of an iWay Service Manager UDP listener that has a process that is defined to handle incoming messages. Use the iWay Service Manager Administration Console to help define Java system properties.

The iwmeasure.jar extension provides a simple StatsGather agent that appends each record to a named file.

Do not run the statistics gathering component on a machine that is being measured. The process of receiving the statistics will be measured, creating a loop. You must use two configurations, preferably on separate machines.



x
Tips

Many books are available on queuing theory, the use of available statistics, and the interpretation of displayed fields.

Kushner, Harold J.; Heavy Traffic Analysis of Controlled Queuing and Communications Networks. New York, Springer; (June 8, 2001).


iWay Software