...
Heartbeats for an XVM can be enabled via DDL XML using the <heartbeats> element:
Code Block | ||||
---|---|---|---|---|
| ||||
<servers><xvms> <server<xvm name="my-xvm"> <heartbeats enabled="true" interval="5"> <collectNonZGStats>true</collectNonZGStats> <collectIndividualThreadStats>true</collectIndividualThreadStats> <collectSeriesStats>true</collectSeriesStats> <collectSeriesDatapoints>false</collectSeriesDatapoints> <maxTrackableSeriesValue>100000000</maxTrackableSeriesValue> <includeMessageTypeStats>false</includeMessageTypeStats> <collectPoolStats>true</collectPoolStats> <poolDepletionThreshold>1.0</poolDepletionThreshold> <logging enabled="true"></logging> <tracing enabled="true"></tracing> </heartbeats> </server>xvm> </servers>xvms> |
Configuration Setting | Default | Description | ||||||
---|---|---|---|---|---|---|---|---|
enabled | false | Enable or disable server stats collection and heartbeat emission.
| ||||||
interval | 1000 | The interval in seconds at which server stats will be collected and emitted. | ||||||
collectNonZGStats | true | Some statistics collected by the stats collection thread require creating a small amount of garbage. This can be set to false to supress collection of these stats. | ||||||
collectIndividualThreadStats | true | Indicates whether heartbeats will contains stats for each active thread in the JVM. Individual thread stats are useful | ||||||
collectSeriesStats | true | Indicates whether or not series stats should be included in heartbeats. | ||||||
collectSeriesDatapoints | false | Indicates whether or not series stats should report the data points captured for a series statistic.
| ||||||
maxTrackableSeriesValue | 10 minutes | The maximum value (in microseconds) that can be tracked for reported series histogram timings. Datapoints above this value will be downsampled to this value, but will be reflected in the max value reported in an interval. | ||||||
includeMessageTypeStats | false | Sets whether or not message type stats are included in heartbeats (when enabled for the app). When captureMessageTypeStats is enabled for an app, the AepEngine will record select statistics on a per message type basis. Because inclusion of per message type stats can significantly increase the size of heartbeats, inclusion in heartbeats is disabled by default.
| ||||||
collectPoolStats | true | Indicates whether or not pool stats are collected by the server when nv.server.stats.enable=true.XVM. | ||||||
poolDepletionThreshold
| 1.0 | Configuration property used to set the percentage decrement at which a preallocated pool must drop to be included in a server heartbeat. Setting this to a value greater than 100 or less than or equal to 0 disables depletion threshold reporting. This gives monitoring applications advanced warning if it looks like a preallocated pool may soon be exhausted. By default the depletion threshold is set to trigger inclusion in heartbeats at every 1% depletion of the preallocated count. This can be changed by specifying the configuration property nv.server.stats.pool.depletionThreshold to a float value between 0 and 100. For example: Setting this to a value greater than 100 or less than or equal to 0 disables depletion threshold reporting.
| ||||||
loggingfalse | See below | Configures binary logging of heartbeats. Binary heartbeat logging provides a means by which heartbeat data can be captured in a zero garbage fashion. Collection of such heartbeats can be useful in diagnosing performance issues in running apps. | ||||||
tracingfalse | See below | Configures trace logging of heartbeats.Binary heartbeat logging provides a means by which heartbeat data can be captured in a zero garbage fashion. Collection of such heartbeats can be useful in diagnosing performance issues in running apps Enabling textual tracing of heartbeats is a useful way to quickly capture data from server heartbeats for applications that aren't monitoring xvm heartbeats remotely. Textual trace of heartbeats is not zero garbage and is therefore not suitable for applications that are latency sensitive. |
Enabling Global Stats
An XVM collects stats that are enabled for the applications that it contains. The followings stats can be enabled and reported in heartbeats
...
When heartbeats are enabled they can be consumed or emitted in several ways, discussed below.
Heartbeat Tracing
...
By default all server statistics tracers are disabled as trace logging is not zero garbage and introduces cpu overhead in computing statistics. While tracing heartbeats isn't recommended in production, enabling server statistics trace output can be useful for debugging and performance tuning. To enable you will need to configure the appropriate tracers at the debug level. See the Heartbeat Trace Output Trace Loggers section for more detail.
Code Block | ||
---|---|---|
| ||
<servers><xvms> <server name<xvmname="my-xvm"> <heartbeats enabled="true" interval="5"> <logging enabled="true"></logging> <tracing enabled="true"></tracing> </heartbeats> </server>xvm> </servers>xvms> |
...
Heartbeat Logging
Applications that are latency sensitive might prefer to leave all tracers disabled to avoid unnecessary allocations and the associated GC activity. As an alternative, it's possible to enable logging of zero-garbage heartbeat messages to a binary transaction log:
Code Block | ||
---|---|---|
| ||
<servers><xvms> <server<xvm name="my-xvm"> <heartbeats enabled="true" interval="5"> <logging enabled="true"> <storeRoot>/path/to/heartbeat/log/directory</storeRoot> </logging> </heartbeats> </server>xvm> </servers>xvms> |
When a storeRoot is not set, an xvm XVM will log heartbeats to {XRuntime.getDataDirectory}/server-heartbeats/<xvm-name>-heartbeats.log, which can then be queried and traced from a separate process using the Stats Dump Tool.
...
- DDL Reference for more options that can be used to configure heartbeat logging.
Heartbeat Event Handlers
Your application can register an event handler for server heartbeats to handle them in process.
...
A Lumino or Robin controller can also be used to connect to a server via a direct admin connection over TCP to listen for heartbeats for monitoring purposes. The XVMs stats thread will queue copies of each emitted heartbeats to each connected admin client.
Anchor | ||||
---|---|---|---|---|
|
When heartbeat tracing is enabled heartbeat Heartbeat trace is emitted to the nv.server.heartbeat
logger at a level of info
. This section discussed the output format of heartbeats INFO
. Trace is only emitted for the types of heartbeat trace for which tracing has been enabled. This section discusses the various types of heartbeat trace, how the trace for those types is enabled and an explanation on the trace output for each of the types.
See Also:
- X Platform Tracing and Logging for general details information on configuration of trace logging.
System Stats
Appears in trace output when nv.server.stats.enable=true and nv.server.stats.sys.trace=debug
Code Block | ||||
---|---|---|---|---|
| ||||
<servers><xvms> <server<xvm name="my-xvm"> <heartbeats enabled="true" interval="5"> <tracing enabled="true"> <traceSysStats>true</traceSysStats> </tracing> </heartbeats> </server>xvm> </server>xvms> |
Sample Trace Output
div | ||
---|---|---|
| ||
|
...
- Initial heap size
- Heap used
- Heap committed
- Max heap size
- Initial non-heap size
- Non-heap memory used
- Non-heap memory committed
- Non-heap memory max size
For more info regarding the process statistics above, you can reference the Oracle JavaDoc on MemoryUsage.
JDK 7 or newer is needed to collect all available memory stats. In addition some stats are not available on all jvms.
...
Individual thread stats can be traced by setting the following in DDL:
Code Block | ||||
---|---|---|---|---|
| ||||
<servers><xvms> <server<xvm name="my-xvm"> <heartbeats enabled="true" interval="5"> <collectIndividualThreadStats>true</collectIndividualThreadStats> <tracing enabled="true"> <traceThreadStats>true</traceThreadStats> </tracing> </heartbeats> </server>xvm> </server> |
...
xvms> |
Sample Trace Output
div | ||
---|---|---|
| ||
|
...
Pools stats can be traced by setting the following in DDL:
Code Block | ||||
---|---|---|---|---|
| ||||
<servers><xvms> <server<xvm name="my-xvm"> <heartbeats enabled="true" interval="5"> <collectPoolStats>true</collectIndividualThreadStats>collectPoolStats> <tracing enabled="true"> <tracePoolStats>true</tracePoolStats> </tracing> </heartbeats> </server>xvm> </server>xvms> |
To reduce the size of heartbeats, Pool Stats for a given pool are only included when:
- A miss has been recorded for the pool in a given interval and it results in a new object being allocated.
- The number of preallocated obects taken from a pool drops below the configured value for the pool depletion threshold.
Sample Trace Output
div | ||
---|---|---|
| ||
|
Stat | Description |
---|---|
PUT | The overall number of times items were put (returned) to a pool. |
DPUT | The number of times items were put (returned) to a pool since the last time the pool was reported in a heartbeat (the delta). |
GET | The overall number of times an item was taken from a pool.
|
DGET | The number of times an item was taken from a pool since the last time the pool was reported in a heartbeat (the delta). |
HIT | The overall number of times that an item taken from a pool was satisfied by there being an available item in the pool. |
DHIT | The number of times that an item taken from a pool was satisfied by there being an available item in the pool since the last time the pool was reported in a heartbeat(the delta). |
MISS | The overall number of times that an item taken from a pool was not satisfied by there being an available item in the pool resulting in an allocation. |
DMISS | The number of times that an item taken from a pool was not satisfied by there being an available item in the pool resulting in an allocation since the last time the pool was reported in a heartbeat. |
GROW | The overall number of times the capacity of a pool had to be increased to accomodate returned items. |
DGROW | The number of times the capacity of a pool had to be increased to accomodate returned items since the last time the pool was reported in a heartbeat. |
EVIC | The overall number of items that were evicted from the pool because the pool did not have an adequate capactiy to store them. |
DEVIC | The overall number of items that were evicted from the pool because the pool did not have an adequate capactiy to store them since the last time the pool was reported in a heartbeat. |
DWSH | The overall number of times that an item return to the pool was washed (e.g. fields reset) in the detached pool washer thread. |
DDWSH | The number of times that an item return to the pool was washed (e.g. fields reset) in the detached pool washer thread since the last time the pool was reported in a heartbeat |
SIZE | The number of items that are currently in the pool available for pool gets. This number will be 0 if all objects that have been allocated by the pool have been taken.
|
PRE | The number of items initially preallocated for the pool. |
CAP | The capacity of the backing array that is allocated to hold available pool items that have been preallocated or returned to the pool.
|
NAME | The unique identifier for the pool. |
...
Engine Stats
Stats that you defined in collected by the AEP engine underlying your application are emitted, they can be included in trace with the following configuration:also included in heartbeats. Tracing of engine stats can be enabled with the following.
Code Block | ||||
---|---|---|---|---|
| ||||
<xvms>
<xvm name="my-xvm">
<heartbeats enabled="true" interval="5">
<tracing enabled="true">
<traceAppStats>true</traceAppStats>
</tracing>
</heartbeats>
</xvm>
</xvms> |
See AEP Engine Statistics for more detail about engine stats.
User Stats
User stats collected by your application are also included in heartbeats. Tracing of user stats can be enabled with the following.
Code Block | ||||
---|---|---|---|---|
| ||||
<servers><xvms> <server<xvm name="my-xvm"> <heartbeats enabled="true" interval="5"> <tracing enabled="true"> <traceUserStats>true</traceUserStats> </tracing> </heartbeats> </server>xvm> </server>xvms> |
Sample Trace Output
div | ||
---|---|---|
| ||
|
...
- User Defined App Stats for adding stats specific to your application to heartbeats.
Aep Engine Stats
The aep engine stats underlying your application are also included in heartbeats. Tracing of aep stats can be enabled with the following.
...
<servers>
<server name="my-xvm">
<heartbeats enabled="true" interval="5">
<tracing enabled="true">
<traceAppStats>true</traceAppStats>
</tracing>
</heartbeats>
</server>
</server>
Trace Output
The trace output
See Also:
- AEP Engine Statistics for more detail about app-level stats.