d8888 888 888      88888888888 888      d8b                                 888       888          888       .d8888b.           888                               
      d88888 888 888          888     888      Y8P                                 888   o   888          888      d88P  Y88b          888                               
     d88P888 888 888          888     888                                          888  d8b  888          888      Y88b.               888                               
    d88P 888 888 888          888     88888b.  888 88888b.   .d88b.  .d8888b       888 d888b 888  .d88b.  88888b.   "Y888b.   88888b.  88888b.   .d88b.  888d888 .d88b.  
   d88P  888 888 888          888     888 "88b 888 888 "88b d88P"88b 88K           888d88888b888 d8P  Y8b 888 "88b     "Y88b. 888 "88b 888 "88b d8P  Y8b 888P"  d8P  Y8b 
  d88P   888 888 888          888     888  888 888 888  888 888  888 "Y8888b.      88888P Y88888 88888888 888  888       "888 888  888 888  888 88888888 888    88888888 
 d8888888888 888 888          888     888  888 888 888  888 Y88b 888      X88      8888P   Y8888 Y8b.     888 d88P Y88b  d88P 888 d88P 888  888 Y8b.     888    Y8b.     
d88P     888 888 888          888     888  888 888 888  888  "Y88888  88888P'      888P     Y888  "Y8888  88888P"   "Y8888P"  88888P"  888  888  "Y8888  888     "Y8888  
                                                                 888                                                          888                                        
                                                            Y8b d88P                                                          888                                        
                                                             "Y88P"                                                           888   

All Things WebSphere

Concerns and issues relating to all versions of WebSphere Application Server

Tuesday, March 2, 2010


Dynacache flight recorder wsadmin script

To debug problems or examine the performance characteristics of Dynacache over long runs, we use a wsadmin script to collect cache statistics exposed by the Dynacache mbean at a periodic interval. Looking at these statistics helps understand the state of the cache and troubleshoot  any performance issues in the operation of Dynacache. These statistics also help in tuning the cache and improving its effectiveness.

For those customers interested in a deep-dive of cache internals and operations and a wsadmin script for monitoring Dynacache I have provided the script here. The overhead of the script is less than 1%. It is retrieving current cache statistics from the Dynacache mbean. It is acceptable to run this script in a production environment.

The script accepts several parameters required and optional:
  -nodeName - The name of the server node. This parameter is required only if the server name is not unique in the cell.
  -cacheInstance -The JNDI name of the cache instance for which statistics will be collected.  If not specified, statistics will be collected for the  base cache only.  "*" indicates all cache instances.
  -sleepUnit -The unit for sleep intervals. Possible values: hours, minutes or seconds.  Default is seconds.
  -sleepInterval - The number of sleep units between polls.  Default is 10.
  -fileAppend - If specified, statistics are appended to the file, if it already exists.  Otherwise, the file is recreated. optional
  -csvSeparator - The character used for the CSV field separator. Default is ",". optional
  -cacheType - An optional filter on caches. A single character should be specified as its value. A value of w or W or m or M specifies WXS-DynaCache, whereas a value of t or T specified traditional Dynacache. By default there cache filtering is turned off. The filter can be conveniently used with the 'cacheInstance' parameter. A parameter combination "-cacheInstance * -cacheType w" will collect statistics for all the configured WXS DynaCache instances in the environment 

./wsadmin.sh -lang jython -f DynaCacheStatisticsCSV.py <SERVER_NAME> <LOG_FILE> "-nodeName <NODE_NAME> -cacheInstance <*|CACHE_INSTANCE_NAME> -sleepUnit <hours|minutes|seconds> -sleepInterval <SLEEP_UNITS> "

Sample Usage:
nohup ./wsadmin.sh -user -password -lang jython -f DynaCacheStatisticsCSV.py WC_wcsperf1 /wcsuser/scripts/dcmon/disk_cache_debug.log "-nodeName app11 -cacheInstance baseCache -sleepUnit minutes -sleepInterval 5" &

WC_wcsperf1 is the server name, app11 is the node name and /wcsuser/scripts/dcmon/disk_cache_debug.log is the file that contains the recorded statistics.

Please verify that the cache statistics file is being written too once the wsadmin script is kicked off. Once the test run is over suck the cache statistics log file into microsoft excel or open-office as a CSV file and graph the relevant statistics. Interpretation of the statistics will be in a subsequent blog post.

I encountered an issue with the script if servlet caching is not enabled. The Error was as follows
WASX7017E: Exception received while running file "C:\IBM\WebSphere70\scripts\DynaCacheStatisticsCSV.py"; exception information: javax.management.MBeanException
javax.management.AttributeNotFoundException: baseCache is not a valid cache instance name.

This is due to the fact the baseCache CacheInstances is not available if servlet Caching is disabled.
I had to modify the script to get it to function correctly without servlet caching enabled

sent the updated script to the author of this blog entry for review and possibly updating the script linked here
In the above post you mention that Interpretation of the statistics will be in a subsequent blog post. But I don't see any documentation.
I am going to start using your script above, and it would be handy to have some help interpreting the data.
Such a great article it was which the overhead of the script is less than 1%. It is retrieving current cache statistics from the Dynacache mean.In which the JNDI name of the cache instance for which statistics will be collected. If not specified, statistics will be collected for the base cache only. Thanks for sharing this article.

Post a Comment

Subscribe to Post Comments [Atom]

Links to this post:

Create a Link

<< Home


December 2006   September 2008   January 2009   February 2009   March 2009   September 2009   October 2009   November 2009   December 2009   January 2010   February 2010   March 2010   April 2010   October 2010   January 2011   February 2011   April 2011   May 2011   June 2011   July 2011   August 2011   September 2011   October 2011   November 2011   December 2011   January 2012   February 2012   March 2012   April 2012   May 2012   June 2012   July 2012   August 2012   September 2012   October 2012   November 2012   January 2013   May 2013   June 2013   July 2013   September 2013   October 2013  

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]