View comments | RSS feed

Monitoring the web server connection

JRun can write status information to the JRun log files about the connection between a JRun server and a web server. You can obtain this status information from the connection between a JRun server and a third-party web server or the JRun web server (JWS).

To enable JRun to collect connection status information, you enable metrics logging, either through the JMC or by setting the metricsEnabled attribute of the LoggerService to true in a JRun server's jrun.xml file.

For more information on the JRun logging mechanism, see Chapter 4, "Logging". For more information on the JMC, see the JMC online Help.

The following example shows the metricsEnabled attribute set to true:

...
<service class="jrunx.logger.LoggerService" name="LoggerService">
��<attribute name="errorEnabled">true</attribute>
��<attribute name="warningEnabled">true</attribute>
��<attribute name="infoEnabled">true</attribute>
��<attribute name="debugEnabled">false</attribute>
��<attribute name="metricsEnabled">true</attribute>
...

The metrics logger writes information to the JRun server's log file at intervals specified by the metricsLogFrequency attribute. This value is specified in seconds and the default is 60 seconds.

The metricsFormat attribute controls the information written to a log file.

Use the web prefix to capture metrics for the JRun web server.; use the jrpp prefix to captures statistics for the web server connector. Statistics that have no prefix are for the JVM associated with the JRun server.

The metricsFormat attribute can contain literal text and any or all of the following metrics variables:
Metrics variable
Description
[web.|jrpp.]listenTh
Threads listening for a new connection
[web.|jrpp.]idleTh
Threads waiting for a new request
[web.|jrpp.]delayTh
Threads waiting to run
[web.|jrpp.]busyTh
Threads currently running
[web.|jrpp.]totalTh
Total worker thread count
[web.|jrpp.]delayRq
Requests delayed due to high concurrency
[web.|jrpp.]droppedRq
Requests dropped
[web.|jrpp.]handledRq
Requests handled
[web.|jrpp.]handledMS
Milliseconds spent servicing requests not including any delay time (delayMs)
[web.|jrpp.]delayMs
Milliseconds spent in delay state
[web.|jrpp.]bytesIn
Bytes read from request
[web.|jrpp.]bytesOut
Bytes written to response
freeMemory
Kilobytes of free memory in the heap
totalMemory
Total Kilobytes in the heap (in use and free)
sessions
Current number of active sessions
sessionsInMem
Number of sessions in memory

The following example shows attributes for the metrics logger:

...
<service class="jrunx.logger.LoggerService" name="LoggerService">
��<attribute name="errorEnabled">true</attribute>
��<attribute name="warningEnabled">true</attribute>
��<attribute name="infoEnabled">true</attribute>
��<attribute name="debugEnabled">false</attribute>
��<attribute name="metricsEnabled">true</attribute>
��<attribute name="metricsLogFrequency">10</attribute>
��<attribute name="metricsFormat">Web threads (busy/total): {jrpp.busyTh}/{jrpp.totalTh}
��  Sessions: {sessions} Total Memory={totalMemory} Free={freeMemory}</attribute>
...

The following example shows the log message for this format:

02/14 16:11:53 metrics Web threads (busy/total): 0/2 Sessions: 2 Total Memory=7252 Free=3103

Comments


ColonelNusterd said on Mar 3, 2004 at 7:40 AM :
Is it possible to get values for AvgQueueTime & AvgReqTime when running CFMX for J2EE on JRun? If so, what is the proper syntax? I've tried the following in our jrun.xml file:

AvgQTime: {jrpp.AvgQueueTime}
AvgRTime: {jrpp.AvgReqTime}

These are just displayed as jrpp.AvgQueueTime & jrpp.AvgReqTime in our log, their values are not resolved. All other attributes are displayed properly (ex. jrpp.listenTh).
jrunrandy said on Mar 3, 2004 at 10:22 AM :
These are values for ColdFusion. They don't work for JRun connection monitoring.
No screen name said on Jul 14, 2004 at 3:21 AM :
Coldfusion MX 6.1
1) Why is the variable for jrpp.busyTh and jrpp.totalTh missing.
My log looks like that:

14/07 12:09:04 metrics Web threads (busy/total): {jrpp.busyTh}/{jrpp.totalTh} Sessions: 0 Total Memory=38996 Free=6671

2) how can I increase free memory?

Thanks.
Best,
Torsten
ccapodilupo said on Sep 7, 2004 at 12:49 PM :
I also do not see the actual values in the log but just the names of the variables as below:

{jrpp.busyTh}/{jrpp.totalTh}

Also, it says Memory=285440 Free=29662
but I have 768 MB allocated to the heap in CF admin, any ideas?

Thanks for any help you can offer,
Craig
No screen name said on Sep 9, 2004 at 12:01 AM :
According to the article:

http://www.macromedia.com/special/under_the_hood/report3/

By modifying the JRun logging configuration you can redirected metrics data to its own log file. How can this be done? Many thanks

Simon
soup dog said on Sep 9, 2004 at 12:11 AM :
How do you quickly answer you own question? Use google!

Taken from:
http://www.bpurcell.org/macromedia/coldfusion.cfm?mode=cat&catid=2

To set metrics logging (actually all logging levels) to be written to their own log file edit {servername}/SERVER-INF/jrun.xml and modify the entry
<attribute name="filename">{jrun.rootdir}/logs/{jrun.server.name}-event.log</attribute>
in jrun.xml. Change it to the following
<attribute name="filename">{jrun.rootdir}/logs/{jrun.server.name}- {log.level}. log</attribute>
rmeier said on Sep 9, 2004 at 1:54 AM :
Here is a way to write the metrics in csv file format. useful to make excel charts for example

jrun.xml:
<service class="jrunx.logger.LoggerService" name="LoggerService">
<!-- attribute name="format">{server.date}; {log.level}; {log.message}; {log.exception}</attribute -->
<!-- You can modify format to suit your need. -->

<attribute name="errorEnabled">true</attribute>
<attribute name="warningEnabled">false</attribute>
<attribute name="infoEnabled">false</attribute>
<attribute name="debugEnabled">false</attribute>
<!-- You may also need to uncomment MetricsService if you want metrics enabled -->
<attribute name="metricsEnabled">true</attribute>
<attribute name="metricsLogFrequency">30</attribute>
<attribute name="metricsFormat">;{scheduler.listenTh};{scheduler.delayTh};{scheduler.idleTh};{scheduler.busyTh};{scheduler.totalTh};{scheduler.delayRq};{scheduler.droppedRq};{scheduler.delayMs}</attribute>
<service class="jrunx.logger.ThreadedLogEventHandler" name="ThreadedLogEventHandler">
<service class="jrunx.logger.ConsoleLogEventHandler" name=":service=ConsoleLogEventHandler" >
<attribute name="format">{date dd.MM.yyyy HH:mm:ss} {log.message}</attribute>
</service>
<service class="jrunx.logger.FileLogEventHandler" name="FileLogEventHandler">
<attribute name="metricsEnabled">false</attribute>
<attribute name="heading"># Created by JRun on {date MM/dd HH:mm:ss}; FileLogHandler</attribute>
<attribute name="format">{date dd.MM.yyyy HH:mm:ss} {log.message}</attribute>
<attribute name="filename">{jrun.rootdir}/logs/{jrun.server.name}/{log.level}/{jrun.server.name}-{log.level}_{date}.log</attribute>
<attribute name="rotationSize">5000k</attribute>
<attribute name="rotationFiles">20</attribute>
<attribute name="closeDelay">5000</attribute>
<attribute name="deleteOnExit">false</attribute>
</service>
<service class="jrunx.logger.FileLogEventHandler" name="MetricsFileLogEventHandler">
<attribute name="heading">Date;Time;;scheduler.listenTh;scheduler.delayTh;scheduler.idleTh;scheduler.busyTh;scheduler.totalTh;scheduler.delayRq;scheduler.droppedRq;scheduler.delayMs</attribute>
<attribute name="format">{date dd.MM.yyyy};{date HH:mm:ss};{log.message}</attribute>
<attribute name="filename">{jrun.rootdir}/logs/{jrun.server.name}/{jrun.server.name}-{log.level}_{date}.csv</attribute>
<attribute name="rotationSize">5000k</attribute>
<attribute name="rotationFiles">20</attribute>
<attribute name="closeDelay">5000</attribute>
<attribute name="deleteOnExit">false</attribute>
</service>
</service>
</service>

Reto Meier
webappermb said on Nov 11, 2004 at 5:52 PM :
To answer the two questions regarding {jrpp.busyTh}/{jrpp.totalTh} not being parsed, you need to take out the jrpp. from the expression. So change to {busyTh}/{totalTh}
dougk said on Dec 2, 2004 at 8:13 AM :
Reto,

<service class="jrunx.logger.FileLogEventHandler" name="MetricsFileLogEventHandler">
does not work. What are the available options for the NAME attribute here? I see nothing about this in the JRun live docs. If you utilise {log.level} you can get teh metrics into its own log file, but I can't get a custom header for it only though.
csteinola said on Sep 30, 2005 at 12:01 PM :
Is it possible to poll JRUN to get the current log format?

Since the log format is so configurable, I'd like to be able to determine which column/element in the .log file is what without having to hardcode it in my reader. So that, if one of my servers outputs to the log as
{scheduler.listenTh};{scheduler.delayTh};{scheduler.idleTh};{scheduler.busyTh};{scheduler.totalTh};
and another of my servers outputs to the log as
{scheduler.idleTh};{scheduler.totalTh};
I can use the same code to read both logs and determine what values correlate to what attributes.

I thought about reading the JRUN.XML... but in many cases, the actual elements are not specified in the metricsFormat attribute.
No screen name said on Oct 3, 2005 at 2:01 PM :
Should I be concerned if:
1/ the number of sessions and sessions in memory are the same?
2/ the number of sessions never goes down?

In other words, how do I finish sessions and remove them from memory? I'm happy to accept that it's something I've missed, or if garbage collection occurs after a set period of time.
Cup O' Java said on Apr 11, 2006 at 7:58 PM :
You can format the metrics logging output further I have found and makes it easier on the eyes to read:

<attribute name="metricsFormat"> PERFORMANCE STATS

######################################################

PLUGIN THREADS:
Listen={jrpp.listenTh} Idle={jrpp.idleTh} Running={jrpp.busyTh}
Delayed/Waiting={jrpp.delayRq} Time Delayed={jrpp.delayMs}
Dropped={jrpp.droppedRq} Completed={jrpp.handledRq} Time To Complete={jrpp.handledMs}
Total={jrpp.totalTh}

SCHEDULER THREADS:
Listen={scheduler.listenTh} Idle={scheduler.idleTh} Running={scheduler.busyTh}
Dropped={scheduler.droppedRq} Delayed/Waiting={scheduler.delayTh} Time Delayed={scheduler.delayMs}
Total={scheduler.totalTh}

SESSION COUNTS:
Session={sessions} Sessions In Memory={sessionsInMem}

PLUGIN STATS:
Bytes In={jrpp.bytesIn} Bytes Out={jrpp.bytesOut}

SERVER STATS:
Total Memory={totalMemory} Free={freeMemory}

######################################################
</attribute>
Cup O' Java said on Apr 11, 2006 at 8:01 PM :
Here's a snip of what it looks like when it prints in the JRun event log:

04/11 22:58:29 metrics PERFORMANCE STATS

######################################################

PLUGIN THREADS:
Listen=100 Idle=2 Running=0
Delayed/Waiting=0 Time Delayed=0
Dropped=0 Completed=1 Time To Complete=20
Total=102

SCHEDULER THREADS:
Listen=22 Idle=0 Running=1
Dropped=0 Delayed/Waiting=0 Time Delayed=0
Total=23

SESSION COUNTS:
Session=56 Sessions In Memory=56

PLUGIN STATS:
Bytes In=978 Bytes Out=0

SERVER STATS:
Total Memory=1004928 Free=914422

######################################################

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/jrun/4/JRun_Administrators_Guide/netmon2.htm