Using JRun Metrics Instead of CFSTAT
Using JRun Metrics Instead of CFSTAT on ColdFusion MX
If you install ColdFusion MX 6.1 in the Standalone mode and you want to get realtime statistics on how the server is operating then you can use JRun metrics. There are several advantages that the metrics offers over cfstat. The one disadvantage is that it does not provide exactly the same data.
Advantages of JRun Metrics over CFSTAT
Logs directly to the JRun logs with timestamps
Format is customizable
Provides JVM memory information
It is pretty simple to enable JRun metrics Open the file /CFusionMX/runtime/servers/default/SERVER-INF/jrun.xml
Uncomment the entry <div class="code"><FONT COLOR=NAVY><FONT COLOR=FF8000><service class=<FONT COLOR=BLUE>"jrunx.metrics.MetricsService"</FONT> name=<FONT COLOR=BLUE>"MetricsService"</FONT>></FONT></FONT>
<FONT COLOR=GREEN><attribute name=<FONT COLOR=BLUE>"bindToJNDI"</FONT>></FONT>true<FONT COLOR=GREEN></attribute></FONT>
<FONT COLOR=NAVY><FONT COLOR=FF8000></service></FONT></FONT></div>
Inside of <service class="jrunx.logger.LoggerService" name="LoggerService"> modify
<attribute name="metricsEnabled">true</attribute>
<attribute name="metricsLogFrequency">10</attribute>
Modify the attributes (remove the jrpp. prefix)<div class="code"><FONT COLOR=GREEN><attribute name=<FONT COLOR=BLUE>"metricsFormat"</FONT>></FONT>
Web threads (busy/total): {jrpp.busyTh}/{jrpp.totalTh} Sessions: {sessions} Total Memory={totalMemory} Free={freeMemory}
<FONT COLOR=GREEN></attribute></FONT></div>
change to<div class="code"><FONT COLOR=GREEN><attribute name=<FONT COLOR=BLUE>"metricsFormat"</FONT>></FONT>
Web threads (busy/total): {busyTh}/{totalTh} Sessions: {sessions} Total Memory={totalMemory} Free={freeMemory}
<FONT COLOR=GREEN></attribute></FONT></div>
By setting the metrics Log Frequentcy to 10 the metrics data will be logged every 10 second with the following format
10/24 12:34:51 metrics Web threads (busy/total) 0/1 Sessions: 0 Total Memory=12032 Free=5880
One note, if you do not have J2EE sessions enabled in ColdFusion Admin then you will not see the sessions in the metrics
If you want to customize the data that metrics provides then you can use the following attributes
AvgQueueTime, AvgReqTime, busyTh, bytesIn, bytesOut, delayMs, delayRq, delayTh, droppedRq, freeMemory, handledMs, handledRq, idleTh, listenTh, sessions, sessionsInMem, totalMemory, totalTh
In the example below I will log not only busy and total threads I will also log; listening, idle, delayed and total handled.
This format works for ColdFusion MX Standalone:<div class="code"><FONT COLOR=GREEN><attribute name=<FONT COLOR=BLUE>"metricsFormat"</FONT>></FONT>
Web threads (busy/total/listen/idle/delay/handled): {busyTh}/{totalTh}/{listenTh}/{idleTh}/{delayRq}/{handledRq} Sessions: {sessions} Total Memory={totalMemory} Free={freeMemory}
<FONT COLOR=GREEN></attribute></FONT></div>
This format works for ColdFusion MX J2EE version on JRun:<div class="code"><FONT COLOR=GREEN><attribute name=<FONT COLOR=BLUE>"metricsFormat"</FONT>></FONT>
Web threads (busy/total/listen/idle/delay/handled): {jrpp.busyTh}/{jrpp.totalTh}/{jrpp.listenTh}/{jrpp.idleTh}/{jrpp.delayRq}/{jrpp.handledRq} Sessions: {sessions} Total Memory={totalMemory} Free={freeMemory}
<FONT COLOR=GREEN></attribute></FONT></div>
Comments
There are no comments for this page as yet.
print page
