MQTC v2016 IIB Performance Final
MQTC v2016 IIB Performance Final
Tuning
Christopher Frank
Whats New
Deployment Considerations
Summary
Runtime
Runtime
MQ MQ
HTTP HTTP
SOAP SOAP
JMS JMS
Database Database
EIS EIS
Node Instance
MQ MQ
HTTP HTTP
SOAP SOAP
JMS JMS
Database Database
EIS EIS
Node Instance
Node
Availability
Integration Integration Integration
(bipservice)
Server 1 Server 2 Server N
Administrative
Agent
(bipbroker)
Node wide
HTTP listener
(biphttplistener) (DataFlowEngine) (DataFlowEngine) (DataFlowEngine)
Consists of:
Message flows
Message sets/schemas/maps
Embedded JVM
Configurable services
Network connections (HTTP/TCP)
Node management infrastructure threads
Integration
API Web UI Commands
(incl CMP)
MQ MQ
HTTP Node Instance HTTP
SOAP SOAP
JMS EG 1 EG 2 EG n JMS
Database Database
EIS EIS
Well quickly review what these were for the last few product releases
Graphical Mapping
Graphical Data Mapper (GDM) introduced in V8 provides better visual transformation experience
Also has excellent performance characteristics
Make it a viable option for performance sensitive transformations.
Tests have been measured performing close to optimised programmatic transformations in ESQL,
Java and .Net, with the typical measurement being 50%.
Performance Analysis of message flows using Resources Statistics and Activity Log
Not a performance enhancement per se
Allows deeper analysis, understanding of performance related issues, quicker resolution/improvement
O A new Graphical Data Mapper (GDM) was also introduced. The new mapping node has excellent performance characteristics, and
is a viable option for performance sensitive transformations. Tests have been measured performing close to optimised
programmatic transformations in ESQL, Java and .Net, with the typical measurement being 50%.
Performance Analysis of message flows using Resources Statistics and Activity Log is not a performance enhancement per se, but
T tools that enable deeper analysis and understanding of performance related issues, enabling more rapid identification of performance-
related problems and quicker resolution and/or improvement, either through tuning of WMB itself, but also in understanding and
modifying message flows to maximize throughput and minimize resource consumption.
Similar performance gains for flows processing messages over HTTP and TCP/IP
A new Web UI statistics view enables runtime performance to be analysed and monitored
More detailed information available, with less overhead to gather
Copyright IBM 2016 17 IBM Integration Bus Capitalware's MQ Technical Conference v2.0.1.6
Performance improvements in IIB V9 over WMB V8
Still more performance improvements were incorporated into IIB V9. Performance of V9 exceeds that of WMB V8 by more than 20%
N when using the DFDL parser for data parsing and serialisation, and the Graphical Data Mapper for message transformation.
Message flows that process messages over HTTP and TCP/IP also saw similar performance gains. And in all other areas,
performance is equal to or better than WMB V8.
O A new WebUI statistics view enables more detailed monitoring and analysis of message flow runtime performance.
Changes to transaction management in V10 yielded an unexpected gain - prior to V10, MQ was always committed for every
transaction, whether MQ nodes were used or not. With V10, MQ is only called at commit time when enlisted in the transaction - on a
HTTPInput -> HTTPOutput flow, we saw a 30% performance increase by removing this.
T The changes to the admin interface improved response times for administration requests by as much as 33% for functions such as
connect and deploy, and 23% for start and stop.
Out-of-the-box defaults have been improved for SOAP, HTTP and TCP/IP ensuring that TCPNoDelay and connection persistence
E options are set optimally.
Reduced memory in the Integration Server (nee Execution Group) runtime for some key customer scenarios, by the implementation of
shared libraries (as opposed to libraries in v8/v9 which were static), ESQL static improvements, and changes to the internal data
structures for flows and subflows.
S
Parsing
ABCXYZ
<order><name>Mr.Smith</n
Output Message Bit-stream
Model
Root.Body.Level1.Level2.
Level3.Description.Line[1]; Set OutputRoot = InputRoot;
times each
Level3.Description.Line[1]; Set OutputRoot = InputRoot;
isAccess
Resource used and the
Processing Logic
Asynchronous
Single function
Multi-function
Enter Exit
Here Here
Enter Exit
Here Here
Enter
Here
Exit
Here
vs
Data warehouse
Request/Reply
XML to Binary
Binary to XML
Copyright
35 IBM 2016 Capitalware's MQ Technical Conference v2.0.1.6
Multi-function
Separation of multiple types of message of request type
Requires logic to first recognise the message or request type
Requires careful design to ensure design is efficient
Parsers Ordering
XMLNSC for XML 1. Parallel
DFDL for non-XML 2. Sequence
E
the case.
Can also impact the behavior of the MQ log (AMQ7469, etc) again, see previous examples.
Benefit can be very dependant on MQ logger tuning/performance e.g. a too-small LogBufferPages value may result in little benefit resulting from using this.
Also give thought to the impact to downstream getting applications again, see previous examples.
Saves memory
Multiple applications can reference a single copy of a shared lib
Lib1 Lib2
App2 App2
ShLib1
Lib1 Lib2
ShLib2 App3
App3
Lib1 Lib2
VS
27 X
5 msgs/sec 138 msgs/sec
A B C X Y Z
MQMD RFH2
User data (bytes to Mb)
If possible, put important elements nearer the front of the user data
Set MyVariable = <Message Element Z>
Message parsed
A B C X Y Z
MQMD RFH2
User data (bytes to Mb)
vs. Message parsed
Z B C X Y A
MQMD RFH2
User data (bytes to Mb)
Typical Ratio of
CPU Costs
1K msg 16K msg 256K msg
Filter First 1 1 1
Filter Last 1.4 3.4 5.6
<order>
<name>
<first>John</first> DONT
PARSE
<last>Smith</last> THIS
</name>
<item>Graphics Card</item>
<quantity>32</quantity>
<price>200</price>
<date>06/24/2010</date> OR THIS
</order>
Opaque:
Note: Not necessary to code the DOMAIN clause on every CREATE LASTCHILD statement. When creating a child node under parent
P, the child is created by P's parser. So the parser (i.e. the domain) automatically propagates down the tree from the root. There is
a performance and memory gain to be had as a result of not coding DOMAIN on the creation of the child elements.
Message tree copying causes the logical tree to be duplicated in memory and this is computationally expensive
LocalEnvironment LocalEnvironment
Root* Root*
ExceptionList ExceptionList
Environment Environment
InputLocalEnvironment OutputLocalEnvironment
Compute node
InputRoot* OutputRoot
InputExceptionList OutputExceptionList
InputRoot OutputRoot
InputLocalEnvironment OutputLocalEnvironment
InputExceptionList OutputExceptionList
Maximising availability
Solutions (Applications, Services, message flows, etc) deployed using one of:
mqsideploy command
Integration API
Integration Toolkit
Integration Explorer (not in v10, where Web UI BAR deploy is introduced)
Key questions
How many copies of the message should be run
Where should they be run
Consists of:
Message flows
Message sets/schemas
Embedded JVM
Configurable services
Network connections (HTTP/TCP)
Node management infrastructure threads
CPU Depends on flow [3] Depends on flow [3] Depends on flow [3]
Notes:
[1] For a message flow instance in an existing Integration Server
[2] Depends on complexity of configuration
[3] Will be the same level of usage for each option
An Integration Server has a memory overhead which is larger than the per flow overhead
Due to executables, JVM, management threads
Overhead of an Integration Server running on one node versus another is no different
64-bit addressing removes virtual storage constraint than existed with 32-bit
This was the major inhibitor to assigning many message flows to an Integration Server
Availability % Downtime per year Downtime per month Downtime per week
L1 L2
A B C
Availability:
Lets imagine that components A and C, and the links L1 and L2 are 99.999% available
L1 L2
A B C
Availability:
Lets imagine that components A and C, and the links L1 and L2 are 99.999% available
L1 B1 L2
A C
B2
Availability:
As before, components A and C, and the links L1 and L2, are 99.999% available
Although duplicated in the architecture, components B1 and B2 are still significantly less reliable at 90%
L1 L2 98.996%
B1
Availability
A C [~14.5 mins down per day]
B2
Factors to consider;
Availability requirements co-locate those with similar requirements. Allows an Integration Server to be shutdown if
required. Otherwise it might never be possible
Use an EG per application/service or group of applications/services
Balancing of load do not put all high volume message flows in one EG
Separate anti-social applications into their own Integration Server
Level of redundancy and resilience
1 EG with 2 instances VS 2 EG with 1 instance each
Consider allocating high profile, key services in (multiple) dedicated Integration Servers.
Other services can be allocated in shared Integration Servers
Provides isolation and resiliency for the high profile services and reduces over all resource consumption through the
shared Integration Servers.
Suggestions
One node per operating image (LPAR)
Low 10s Integration Servers per node
10-100s message flows including instances within the node
Reasons
Single node easily capable of utilising 4/8/16/32/64 SMP system
Easily manageable
Sufficiently responsive for administrative operations
Areas to consider
Resources
Node
Transports
Databases
Thread Pools
Transactional Processing
Memory
Amount of memory required depends on messages and message flow
Guide is 3-4 GB per CPU
I/O
Disk
Speed of write is very important where logs are used (queue manager and database)
Also for database when BLOBs are inserted
SAN with fast write non-volatile cache is best. Goal is < 1ms for a 10K write
Network
Most environments involve more than a single machine
Today volume of messages is increasing as is size - Recommend 10 Gb network to ensure it is not a bottleneck
End-user oriented
Focus on easily understood actions & resources
GET message queue X, Update DB table Z
Complements quantitative resource statistics
B
Web Servlet Container IIB
HTTP (eg Tomcat, WAS) MQ
Clients Proxy QMGR
Servlet dataflowengine.exe
C
IIB
HTTP dataflowengine.exe
Clients
D Web Server
IIB
(eg WAS Web Server,
HTTP HTTP dataflowengine.exe
Clients IHS Apache Web Server)
Plug-in
biphttplistener
C Integration Server
2
D
http://localhost:7080/serviceC
http://localhost:7080/serviceD Threads
Commands
Display using mqsireportproperties command
Change using mqsichangeproperties command
http://localhost:7800/ServiceA
HTTP(S) Listener
http://localhost:7800/ServiceB Threads
HTTP
Threads
HTTPS
Integration Server
http://localhost:7801/ServiceC
HTTP(S) Listener
http://localhost:7801/ServiceD Threads
HTTP
Threads
HTTPS
Integration Server
Commands
display properties using mqsireportproperties command
Change properties using mqsichangeproperties command
Nodes:
TCPIPClientInput and TCPIPServerInput
TCPIPClientOutput and TCPIPServerOutput
TCPIPClientReceive and TCPIPServerReceive
Tuning
Persistent connections via ExpireConnectionSec setting
Specify TCP_NODELAY as true
Use smallest number of message flow instances possible
Note: XSL and ITX are embedded technologies which process an incoming BLOB and
produce a different BLOB
Do not operate on the message tree directly
As such there can be increased costs through increased parsing when mixing with other
technologies
Transformation-specific Optimizations
ESQL
Java
XPath
WHILE LASTMOVE(myref)=TRUE DO
-- Add 1 to each item in the array
SET myref = myref + 1;
-- Do some processing
-- Move the dynamic reference to the next item in the array
MOVE myref NEXTSIBLING;
END WHILE;
DECLARE A1 INTEGER 1;
DECLARE A2 INTEGER CARDINALITY(InputRoot.XMLNSC.TGT_I0089_GLPOSTING_MSGDEF.IDOC.Z1IF_DATA[]);
DECLARE A1_REF REFERENCE TO InputRoot.XMLNSC.TGT_I0089_GLPOSTING_MSGDEF.IDOC.Z1IF_DATA[1];
WHILE A1 <= A2 DO
MOVE A1_REF TO InputRoot.XMLNSC.TGT_I0089_GLPOSTING_MSGDEF.IDOC.Z1IF_DATA[A1];
SET
OutBodyRef.sapzfglaccdoc01:SapZfglAccDoc01.SapZfglAccDoc01IDocBO.SapZfglAccDoc01DataRecord.SapZfglAccDoc01Z2
ifData000[A1].WapVendor = A1_REF.WAP_VENDOR;
SET
OutBodyRef.sapzfglaccdoc01:SapZfglAccDoc01.SapZfglAccDoc01IDocBO.SapZfglAccDoc01DataRecord.SapZfglAccDoc01Z2
ifData000[A1].WapDivision = A1_REF.WAP_DIVISION;
SET
OutBodyRef.sapzfglaccdoc01:SapZfglAccDoc01.SapZfglAccDoc01IDocBO.SapZfglAccDoc01DataRecord.SapZfglAccDoc01Z2
ifData000[A1].WapStore = A1_REF.WAP_STORE;
SET
...
SET
...
SET A1 = A1 + 1;
END WHILE;
WHILE A1 <= A2 DO
MOVE A1_REF TO InputRoot.XMLNSC.TGT_I0089_GLPOSTING_MSGDEF.IDOC.Z1IF_DATA[A1];
SET
OutBodyRef.sapzfglaccdoc01:SapZfglAccDoc01.SapZfglAccDoc01IDocBO.SapZfglAccDoc01DataRecord.SapZfglAccDoc01Z2ifData000[A1].WapVendor =
A1_REF.WAP_VENDOR;
DECLARE A INTEGER 1;
DECLARE B INTEGER CARDINALITY(Environment.Variables.*[]);
SET JPcntFODS = B;
WHILE A <= B DO
CALL CopyMessageHeaders();
CREATE FIELD OutputRoot.XML.FODS;
DECLARE outRootRef REFERENCE TO OutputRoot.XML.Data;
SET A = A + 1;
PROPAGATE;
END WHILE;
Use REFERENCE variables and the LASTMOVE and the time dropped to
minutes.
Best to determine the size of the array before the while loop (unless it will change in the
loop) so it is only evaluated once
EVAL Statement
Used sometimes when there is need to dynamically determine correlation names. It is expensive in
CPU use though as it effectively involves double execution of a statement
Host variables
Important to use host variables so dynamic SQL statements can be re-used
Host variables map a column value to a variable
SQL PREPARE is expensive so want to reuse where possible.
Statement:
PASSTHRU(UPDATE SHAREPRICES AS SP SET Price = 100 WHERE SP.COMPANY = IBM);
Can only be used when Price is 100 and Company is IBM.
When Price or Company change need another statement, with another PREPARE
Re-coding allows Price and Company to change but still use same statement
PASSTHRU(UPDATE SHAREPRICES AS SP
SET Price = ? WHERE SP.COMPANY = ?,
InputRoot.XMLNSC.Message.Price,InputRoot.XMLNSC.Message.Company);
To see the contents of the dynamic statement cache use the commands:
db2 connect to <database name>
db2 get snapshot for dynamic SQL on <database name>
To access element E of the message tree use the correlation name refPtr.E.
Use REFERENCE and MOVE statements to help reduce the amount of navigation within
the message tree
Very useful when constructing large numbers of SET or CREATE statements.
Instead of navigating to the same branch in the tree you can use a REFERENCE variable to establish a
pointer to the branch and then use the MOVE statement to process one field at a time
This repeatedly navigates from root to build the tree. It is better to store references as follows:
MbElement represents the syntax elements in the logical (hierarchical) view of the
message. Methods are provided for navigating and modifying the hierarchy.
Code such as
keyforCache = hostSystem + CommonFunctions.separator
+ sourceQueueValue + CommonFunctions.separator
+ smiKey + CommonFunctions.separator
+ newElement;
will perform better written as:
If using the JavaCompute node use ByteArrays and ByteArrayOutputStream to process the BLOB.
Garbage collection causes a cessation of processing in the JVM whilst it is taking place and
so it an inhibitor to message throughput.
As example:
Java based transformation message flow ran at 1300 msg/sec without manual GC. Adding one manual GC
call per message being processed took the rate down to 100 msg/sec!
However
Unable to interact with the Message Tree as with ESQL and Java
When used mid-stream with other IIB technologies, it will result in a higher level of message parsing
and serialisation
Not able to share intermediate data with other technologies
Temporary data held in the Environment correlation for example
Most resilient and best performing systems are those that are:
Loosely coupled and have parallel execution (threads and processes)
Implications for your message flow design will depend on the systems that IIB interacts with