0

I want to modify the thread pool size for default, work manager, and so on.. using a wsadmin (jython) scripting. How to change all those maximum and minimum sizes??

I can't seems to find a correct document for change of thread pool settings, "Adminconfi.modify" is not responding for my attributes

  • You could maybe look at this post: http://stackoverflow.com/questions/11773748/websphere-get-thread-pool-id – rghome Jun 02 '15 at 18:48

4 Answers4

2

This makes sense to me. Assuming the ID coming in is the result of getid on the jvm. Get a list of thread pools, then grab the ID's of the thread pools you want to modify (in my case it was the 'Default' and 'WebContainer' Thread pool) then just modify. The adminutil is the crux of this one, else the threadpool "list" is one big nasty useless string.

def setThreadPools(ID):
   threadPools=AdminConfig.list('ThreadPool',ID)
   threadPoolList=AdminUtilities.convertToList(threadPools)
   for tps in threadPoolList:
      if AdminConfig.showAttribute(tps,'name') == 'Default':
         defaultThreadPoolID=tps
      if AdminConfig.showAttribute(tps,'name') == 'WebContainer':
         webcontainerThreadPoolID=tps
   AdminConfig.modify(defaultThreadPoolID, '[[maximumSize "50"] [name "Default"] [minimumSize "20"] [inactivityTimeout "5000"] [description ""] [isGrowable "false"]]')
   AdminConfig.modify(webcontainerThreadPoolID, '[[maximumSize "120"] [name "WebContainer"] [minimumSize "50"] [inactivityTimeout "60000"] [description ""] [isGrowable "false"]]')
   return
1

This worked for me:

pools = AdminConfig.list('ThreadPool', AdminConfig.getid( '/Cell:Cell01/Node:Node01/Server:server1/')).split()
AdminConfig.modify(pools[10], '[[maximumSize "97"] [name "WebContainer"] [minimumSize "50"] [inactivityTimeout "60000"] [description "modified by script"] [isGrowable "false"]]')
AdminConfig.save()

..inspired by pglezen

Community
  • 1
  • 1
0

Sample code To Change Default thread pool :

AdminConfig.modify('(cells/kumaranCell02/nodes/kumaranNode02/servers/server1|server.xml#ThreadPool_1399487666604)', '[[maximumSize "50"] [name "Default"] [minimumSize "10"] [inactivityTimeout "5000"] [description ""] [isGrowable "false"]]')

Sample to change webcontainer thread pool:

AdminConfig.modify('(cells/kumaranCell02/nodes/kumaranNode02/servers/server1|server.xml#ThreadPool_1399487666598)', '[[maximumSize "50"] [name "WebContainer"] [minimumSize "10"] [inactivityTimeout "60000"] [description ""] [isGrowable "false"]]')

Note : You need to change the cell Name, node Name, server name and threadpool Id from the server.xml file.

-2

Modifying thread pool involves multiple steps. First you have to get the Server configuration ID and using which you have to get the webcontainer ID. Once you get that you can perform the modify and then save the configuration to the master repository. Below commands might help you to achieve the same:

serid = AdminConfig.getid('/Server:server1')

webid = AdminConfig.list('WebContainer',serid)

AdminConfig.modify(webid,[['tuningParams', [['invalidationTimeout', '1800'], ['maxInMemorySessionCount', '40']]]])

AdminConfig.modify(webid,[['threadPool', [['inactivityTimeout', '1800'], ['isGrowable', 'false'], ['maximumSize', '29'], ['minimumSize', '5']]]])

Viswa
  • 1
  • 3