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, November 29, 2011

 

Hottest items in the WebSphere Application Server Dynacache Servlet cache



Provided is a DynaCache program that leverages PMI and JMX to output the top 100 templates in the servlet cache in terms of in-memory cache hits. 
You can use this client program to determine which items in the cache are the most popular.

When there are a lot of cache-entries  and consequently templates in the cachespec.xml this tool will give you a good idea of what is hot or not. The utility of this tool decreases when the cache-entry names are not granular. For instance some cachespec.xml's use the single front controller, with a lot of the cache-ids hanging off a usually a single cache-entry. For now the program/tool only looks at the in-memory cache hits and not disk hits. Java src is included in the jar if you want to modify it :-)

Attached jar contains the src and the class files:
http://dl.dropbox.com/u/12872475/Dynacache-WXS/dc-pmi.jar

This program requires the template servlet cache PMI group to be enabled.






























Usage:
C:\WebSphere7\AppServer\java\bin\java -Djava.ext.dirs=C:\WebSphere7\AppServer\runtimes;c:\WebSphere7\AppServer\lib;C:\WebSphere7\AppServer\java\jre\lib;C:\WebSphere7\AppServer\java\jre\lib\ext;C:\WebSphere7\AppServer\lib com.ibm.ws.sample.DynaCachePMIClient localhost 8881-standalone smitaNode01 server1 baseCache
  • Replace C:\WebSphere7\AppServer with your $WAS_HOME &rerun.
  • Program arguments are in orange. 
  • There is also a test.properties that can be modified inside the jar for more granular control, if you do not want to provide arguments.
Output:
host=localhost , port=8881 , connector=SOAP , distributed=false
main: create the adminclient
getAdminClient: hostStr=localhost , portStr=8881
getAdminClient: WasClientPath=C:/WebSphere7/AppServer/profiles/base
*****************************************
DynaCache Automated Tests
Host     : smita.raleigh.ibm.com
Port     : 9081
PMI Port : 8881 connector: SOAP
Cell     : smitaNode01Cell
Node     : smitaNode01
Server   : server1
BaseCacheSize: 2000
Offload to Disk: false
IhsEnabled: true
globalSecurityEnabled: false
IHS Host    : localhost
IHS Port    : 80
Distributed Caching: false
zOSMode: false
*****************************************
Usage: DynaCachePMIClient [ <-distributed|-standalone> ]
Arguments passed in to com.ibm.ws.sample.DynaCachePMIClient
args[0] localhost
args[1] 8881
args[2] -standalone
args[3] smitaNode01
args[4] server1
args[5] baseCache

Found 1
...node:smitaNode01 match: true
...process:server1 match: true
my perf MBean: WebSphere:name=PerfMBean,process=server1,platform=dynamicproxy,node=smitaNode01,version=7.0.0.19,type=Perf,mbeanIdentifier=PerfMBean,cell=smitaNode01Cell,spec=1.0

Get statistics from all cacheModules

stats name=cacheModule.template
    HitsInMemoryCount[21]=23
    HitsOnDiskCount[22]=0
    ExplicitInvalidationCount[23]=0
    LruInvalidationCount[24]=0
    TimeoutInvalidationCount[25]=0
    InMemoryAndDiskCacheEntryCount[26]=4
    RemoteHitCount[27]=0
    MissCount[28]=4
    ClientRequestCount[29]=27
    DistributedRequestCount[30]=0
    ExplicitMemoryInvalidationCount[31]=0
    ExplicitDiskInvalidationCount[32]=0
    LocalExplicitInvalidationCount[34]=0
    RemoteExplicitInvalidationCount[35]=0
    RemoteCreationCount[36]=0

    stats name=/dynacachetests/TimeStamp
        HitsInMemoryCount[21]=11
        HitsOnDiskCount[22]=0
        ExplicitInvalidationCount[23]=0
        LruInvalidationCount[24]=0
        TimeoutInvalidationCount[25]=0
        InMemoryAndDiskCacheEntryCount[26]=2
        RemoteHitCount[27]=0
        MissCount[28]=2
        ClientRequestCount[29]=13
        DistributedRequestCount[30]=0
        ExplicitMemoryInvalidationCount[31]=0
        ExplicitDiskInvalidationCount[32]=0
        LocalExplicitInvalidationCount[34]=0
        RemoteExplicitInvalidationCount[35]=0
        RemoteCreationCount[36]=0

    stats name=/dynacachetests/TimeStamp1
        HitsInMemoryCount[21]=12
        HitsOnDiskCount[22]=0
        ExplicitInvalidationCount[23]=0
        LruInvalidationCount[24]=0
        TimeoutInvalidationCount[25]=0
        InMemoryAndDiskCacheEntryCount[26]=2
        RemoteHitCount[27]=0
        MissCount[28]=2
        ClientRequestCount[29]=14
        DistributedRequestCount[30]=0
        ExplicitMemoryInvalidationCount[31]=0
        ExplicitDiskInvalidationCount[32]=0
        LocalExplicitInvalidationCount[34]=0
        RemoteExplicitInvalidationCount[35]=0
        RemoteCreationCount[36]=0

TOP 100 TEMPLATES IN THE CACHE baseCache
/dynacachetests/TimeStamp1=12
/dynacachetests/TimeStamp=11

Dynacache PMI structure:








Labels:


Comments:

Post a Comment

Subscribe to Post Comments [Atom]



Links to this post:

Create a Link



<< Home

Archives

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   June 2014   August 2014  

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

Subscribe to Posts [Atom]