Search This Blog

Thursday, April 30, 2009

WLST Thread Count

WLST Thread Count in WebLogic 9.x and all higher version the Thread model is depends on WorkManager. The WorkManager internally uses self-tuning threads for each WebLogic Server instances.
-->

To get the thread Model and its Idle count as in the WebLogic 8.1 we need to tune the server instance parameter in the config.xml. While changing this you should be cautious,

 make sure you have  a backup copy the config.xml before editing.
Enter the following line in the child element, given same level as element.






Full detail description about how to change this parameter is given here...
http://download.oracle.com/docs/cd/E13222_01/wls/docs92/perform/appb_queues.html

The WLST script for Thread count monitoring will be as follows: 



######################################################
# This script is used to monitor all servers
# Author: Pavan Devarakonda
# Date:   28th April 2009
######################################################
import thread
 
# Configured user credentials with storeUserConfig
 
 ucf='keypath/xuserconfig.key'
 ukf='keypath/xkeyfile.key'
 admurl = "t3://hostingdns.com:port"
  
 def monitorThrds():
     connect(userConfigFile=ucf, userKeyFile=ukf, url= admurl )
     serverNames = getRunningServerNames()
     domainRuntime()
     print 'EXECUTE QUEUES'
     print ' '
     print 'Execute   Total  Current   PendRequest ServicedRequest'
     print 'QueueName Count  IdleCount CurrCount   TotalCount '
     print '===========**=======**=================================='
     for snam in serverNames:
         try:
                 cd("/ServerRuntimes/" + snam.getName() + "/ExecuteQueueRuntimes/weblogic.kernel.Default") 
                 totcnt=get('ExecuteThreadTotalCount') 
                 idlecnt = get('ExecuteThreadCurrentIdleCount')
                 pndcnt =get('PendingRequestCurrentCount') 
                 sevcnt = get('ServicedRequestTotalCount') 
                 print '%10s  %4d    %4d    %4d   %16d' %  (snam.getName(), totcnt, idlecnt, pndcnt, sevcnt) 
         except WLSTException,e:
                 # this typically means the server is not active, just ignore
                 pass
  
 def getRunningServerNames():
         domainConfig()
         return cmo.getServers()
  
 if __name__== "main":
     monitorThrds()
     disconnect()

No comments:

Facebook Blogger Plugin: By RNHckr.com

Post a Comment

Please write your comment here

Popular Posts