You can use the administrative console or a Jacl script to tune
performance settings for the service integration bus Web services enablement
(SIBWS).
Why and when to perform this task
The SIBWS dynamically selects an optimized route through the code
where possible. If you migrate Web services from the WebSphere Application
Server Version 5 Web services gateway, and you do not use mediations to support
previous Gateway filter applications, then your messages avoid being routed
through the internal infrastructure that enables additional SIBWS functionality.
This fast-path route through the bus is used if the following criteria are
met:
- The inbound port and outbound port for the service are on the same server.
- There are no mediations on the path from the inbound port to the outbound
port.
If your Web services use the fast-path route, you need not tune
mediations or the service integration bus. However it is good practise to
do so, because a typical environment will have at least one non-fast-path
(for example, mediated) service.
To improve the performance of the SIBWS,
you can tune the following parameters:
- The Java virtual machine heap size. This helps ensure there is enough
memory available to process large messages, or messages with large attachments.
- The maximum number of instances of a message-driven bean that are permitted
by the activation specification for the service integration technologies resource
adapter. This throttles the number of concurrent clients serviced.
- The maximum batch size for batches of messages to be delivered to a client.
By default, only a single message is delivered to a message-driven bean instance
at one time; you can improve performance by allowing messages to be sent in
batches to a message-driven bean.
- The number of threads available to service requests for each client. That
is, the number of threads available in the default thread pool, the Web container
thread pool and the mediation thread pool for a given application server.
- The number of threads available in the mediation thread pool. This assumes
that your mediations use concurrent support where appropriate, as explained
in Concurrent mediations.
If you have mediations that act on SOAP headers, you can improve
performance by inserting the associated header schemas (.xsd files)
into the SDO repository.
To tune the SIBWS, complete one of the following
two steps:
If you have mediations that act on SOAP headers, also complete the following
step:
- Optional: To use the administrative console
to tune the SIBWS, complete the following steps:
- Use the topic Tuning Java virtual machines to set the JVM
heap size to a larger value than the default value (256 megabytes). The value
should generally be as large as possible without incurring paging.
- Use the topic Tuning
service integration messaging to tune the maximum number of instances
of a message-driven bean, the maximum batch size for batches of messages for
a bean, and the number of threads available to service requests for a bean.
- Use the topic Tuning the application serving environment to
tune the general application serving environment, in particular the size of
the Web Container Thread Pool. In a server which is exclusively serving requests
to the SIBWS the default thread pool and the Web Container thread pool should
be the same size.
- Use the topic Configuring
the mediation thread pool to configure the number of threads available
to concurrent mediations.
- To use a Jacl script to tune the SIBWS, use the wsadmin scripting client to run a script based
on the following example:
#--------------------------------------------------------------------
# SIBWS WebSphere Tuning Script
#--------------------------------------------------------------------
##
# This script is designed to modify some of the tuning pertinent to a SIBWS
# deployment.
# In order to tune the config parameters, simply change the values
# provided below. This script assumes that all server names in a
# cluster configuration are unique.
#
# To invoke the script, type:
# wsadmin -f tuneWAS.jacl <scope> <id>
# scope - 'cluster' or 'server'
# id - name of target object within scope (ie. servername)
#
# Examples:
# wsadmin -f tuneWAS.jacl server server1
# wsadmin -f tuneWAS.jacl cluster WSGWCluster
#
#
#--------------------------------------------------------------------
$AdminConfig setValidationLevel NONE
puts "Starting script..."
puts "Reading config parameters..."
#--------------------------------------------------------------------
# COMMON CONFIG PARAMETERS
# - Adjust these parameters based on the intended target system (Defaults in parentheses)
#--------------------------------------------------------------------
# WebContainer Thread Pool (10,50)
set minWebPool 10
set maxWebPool 15
# Default Thread Pool - (Multiprotocol MDB) (10,50)
set minDefaultPool 10
set maxDefaultPool 15
# Mediations Thread Pool (1,5)
set minMediationPool 10
set maxMediationPool 15
# HTTP KeepAlive settings (true, 100)
set keepAliveEnabled true
set maxPersistentRequests -1
# Inactivity Timeouts for thread pools (3500)
set inactivity 3500
# JVM properties
set minHeap 1280
set maxHeap 1280
set verboseGC "false"
set genericArgs ""
# J2CActivationSpec for the SIB_RA Resource adapter
set SIB_RA_maxConcurrency 15
set SIB_RA_maxBatchSize 5
# Java2 Security (false for 5.1 and true for 6.0)
set j2Security false
# Parallel server startup
set parallelStart false
#---------------------------------------------
# Check/Print Usage
#---------------------------------------------
proc printUsageAndExit {} {
puts " "
puts "Usage: wsadmin -f tuneWAS.jacl <cluster | server> <name>"
exit
}
#---------------------------------------------
# Misc Procedures
#---------------------------------------------
proc getName {objectid} {
set endIndex [expr [string first "(" $objectid] - 1]
return [string range $objectid 0 $endIndex]
}
#---------------------------------------------
# Parse command line arguments
#---------------------------------------------
puts "Parsing command line arguments..."
if {[llength $argv] < 2} {
printUsageAndExit
} else {
set scope [lindex $argv 0]
puts "Scope: ${scope}"
if {$scope == "cluster"} {
set clustername [lindex $argv 1]
puts "Cluster: ${clustername}"
} elseif {$scope == "server"} {
set servername [lindex $argv 1]
puts "Server: ${servername}"
} else {
puts "Error: Invalid Argument ($scope)"
printUsageAndExit
}
}
#---------------------------------------------
# Obtain server list
#---------------------------------------------
puts ""
puts "Obtaining server list..."
if {$scope == "cluster"} {
set cluster [$AdminConfig getid "/ServerCluster:${clustername}/"]
set temp [$AdminConfig showAttribute $cluster members]
set memberList [split [string trim $temp "{ }"] " "]
foreach member $memberList {
set memberName [getName $member]
lappend serverList [$AdminConfig getid "/Server:${memberName}/"]
}
} else {
set server [$AdminConfig getid "/Server:${servername}/"]
lappend serverList $server
}
#---------------------------------------------
# Print config properties
#---------------------------------------------
puts ""
puts "WebSphere configuration"
puts "-----------------------"
puts ""
puts " Enforce Java2 Security: ${j2Security} "
puts ""
puts "Servers:"
foreach server $serverList {
puts " [getName $server]"
}
puts ""
puts " Web --------------------------------------------"
puts " Min WebContainer Pool Size: ${minWebPool} "
puts " Max WebContainer Pool Size: ${maxWebPool} "
puts " JVM --------------------------------------------"
puts " Min JVM Heap Size: ${minHeap} "
puts " Max JVM Heap Size: ${maxHeap} "
puts " Verbose GC: ${verboseGC}"
puts ""
#---------------------------------------------
# Modify cell parameters
#---------------------------------------------
# Accessing cell based security config
puts "Accessing security configuration..."
set sec [$AdminConfig list Security]
set attrs [subst {{enforceJava2Security $j2Security}}]
puts "Updating security..."
$AdminConfig modify $sec $attrs
#---------------------------------------------
# Modify server parameters
#---------------------------------------------
foreach server $serverList {
set servername [getName $server]
puts ""
puts "Server: $servername"
puts ""
# Accessing server startup config
puts "Accessing server startup configuration..."
puts "Parallel Startup (old/new): [$AdminConfig showAttribute $server parallelStartEnabled]/
$parallelStart"
set attrs [subst {{parallelStartEnabled $parallelStart}}]
puts "Updating server startup..."
puts ""
$AdminConfig modify $server $attrs
# Accessing web container thread pool config
puts "Accessing web container thread pool configuration..."
set tpList [$AdminConfig list ThreadPool $server]
set oI [lsearch -glob $tpList "*WebContainer*"]
set webPool [lindex $tpList $oI]
puts "ThreadPool MaxSize (old/new): [$AdminConfig showAttribute $webPool maximumSize
]/$maxWebPool"
puts "ThreadPool MinSize (old/new): [$AdminConfig showAttribute $webPool minimumSize
]/$minWebPool"
puts "ThreadPool Inactivity Timeout (old/new): [$AdminConfig showAttribute $webPool
inactivityTimeout]/$inactivity"
set attrs [subst {{maximumSize $maxWebPool} {minimumSize $minWebPool} {inactivityTimeout
$inactivity}}]
puts "Updating web container thread pool..."
puts " "
$AdminConfig modify $webPool $attrs
# Accessing default thread pool config
puts "Accessing default thread pool configuration..."
set tpList [$AdminConfig list ThreadPool $server]
set oI [lsearch -glob $tpList "*Default*"]
set webPool [lindex $tpList $oI]
puts "ThreadPool MaxSize (old/new): [$AdminConfig showAttribute $webPool maximumSize
]/$maxDefaultPool"
puts "ThreadPool MinSize (old/new): [$AdminConfig showAttribute $webPool minimumSize
]/$minDefaultPool"
puts "ThreadPool Inactivity Timeout (old/new): [$AdminConfig showAttribute $webPool
inactivityTimeout]/$inactivity"
set attrs [subst {{maximumSize $maxDefaultPool} {minimumSize $minDefaultPool} {inactivityTimeout
$inactivity}}]
puts "Updating default thread pool..."
puts " "
$AdminConfig modify $webPool $attrs
# Creating Mediations Thread Pool
puts "Creating Mediations thread pool"
set me [$AdminConfig list SIBMessagingEngine]
set mtpName [$AdminConfig showAttribute $me name]-mediationThreadPool
set tpAttrs [subst {{name $mtpName} {minimumSize $minMediationPool} {maximumSize
$maxMediationPool}}]
puts "ThreadPool Name : $mtpName"
puts "ThreadPool MaxSize : $maxMediationPool"
puts "ThreadPool MinSize : $minMediationPool"
$AdminConfig create ThreadPool $me $tpAttrs mediationThreadPool
puts "Mediations Thread Pool Created"
puts " "
# Accessing HTTP keepalive config
puts "Accessing HTTP KeepAlive configuration..."
set HTTPInbound [$AdminConfig list HTTPInboundChannel $server]
set oI [lsearch -glob $HTTPInbound "*HTTP_2*"]
set http2 [lindex $HTTPInbound $oI]
puts "KeepAlive Enabled (old/new): [$AdminConfig showAttribute $http2 keepAlive]/
$keepAliveEnabled"
puts "Max Persistent Requests (old/new): [$AdminConfig showAttribute $http2
maximumPersistentRequests]/$maxPersistentRequests"
set attrs [subst {{keepAlive $keepAliveEnabled} {maximumPersistentRequests
$maxPersistentRequests}}]
puts "Updating HTTP KeepAlives..."
puts " "
$AdminConfig modify $http2 $attrs
# Accessing JVM config
puts "Accessing JVM configuration..."
set jvm [$AdminConfig list JavaVirtualMachine $server]
puts "Initial Heap Size (old/new): [$AdminConfig showAttribute $jvm initialHeapSize]/$minHeap"
puts "Maximum Heap Size (old/new): [$AdminConfig showAttribute $jvm maximumHeapSize]/$maxHeap"
puts "VerboseGC Enabled (old/new): [$AdminConfig showAttribute $jvm
verboseModeGarbageCollection]/$verboseGC"
set attrs [subst {{initialHeapSize $minHeap} {maximumHeapSize $maxHeap}
{verboseModeGarbageCollection $verboseGC} }]
puts "Updating JVM..."
puts " "
$AdminConfig modify $jvm $attrs
# Accessing J2CActivationSpec for the SIB Resource Adapter
puts "Modifying the J2CActivationSpec for the SIB Resource Adapter"
set actSpec [$AdminConfig getid /J2CActivationSpec:SIBWS_OUTBOUND_MDB/]
set propSet [$AdminConfig showAttribute $actSpec resourceProperties]
set propSet [lindex $propSet 0]
set maxConcurrency [list value $SIB_RA_maxConcurrency]
set maxConcurrency [list $maxConcurrency ]
set maxBatchSize [list value $SIB_RA_maxBatchSize]
set maxBatchSize [list $maxBatchSize]
foreach propId $propSet {
if { [string compare [$AdminConfig showAttribute $propId name] maxConcurrency] == 0} {
$AdminConfig modify $propId $maxConcurrency
puts "Custom property changed : [$AdminConfig showall $propId] "
}
if { [string compare [$AdminConfig showAttribute $propId name] maxBatchSize] == 0} {
$AdminConfig modify $propId $maxBatchSize
puts "Custom property changed : [$AdminConfig showall $propId] "
}
}
puts "J2CActivationSpec modifications complete"
}
puts ""
puts "Script completed..."
puts "Saving config..."
$AdminConfig save
- Optional: If you have mediations that
act on SOAP headers, insert the associated schemas (.xsd files)
into the SDO repository as described in Including SOAP header schemas in the SDO repository.