Design and Develop an IBM ODM application to optimize Performance

3224 - Design and Develop
an IBM ODM application to
optimize Performance
Pierre-André Paumelle
ODM Performance Architect
[email protected]
© 2015 IBM Corporation
IBM Operational Decision Manager
Manage
Govern
Business Console
Enterprise Console
Access and Control
Decision Artifacts
Decision Center
Versioned Assets
Decision Server
Decision Execution
Decision Monitoring
Web Services – API – GUI – Execution REST API
Rule Execution
Server Console
Rule Designer
Design
POS
Enterprise
Application
Monitor
BPM
CRM
Mobile
1
Decision Service architecture
Rule Engine Execution
IN
Ruleflow
IN
Rules
OUT
BOM to XOM
XOM
ODM Performance team role
• The performance team
• Works on the evolution of the product
– To improve performance
– To improve scalability
•
•
•
•
Measures the performance
Publishes the performance results
Publishes Red papers on tuning and performance of ODM
Follow up of customers
– Performance and scalalbility questions
– Migration from older versions
– Tuning of architecture
3
Performance Evolution of ODM
Performance evolution HTDS SOAP and REST JSON
Sequential execution XML/JAVA XOM
Total factor improvement
11x
16000
22x
20x
19x
SOAP XML XOM V7.1.1 (CRE)
14485
14000
SOAP Java XOM v7.5 (CRE)
12663
SOAP Java XOM V8.0 (CRE)
12000
SOAP JAVA XOM V8.6 (DE)
TPS
10000
REST JSON V8.7 (DE)
8203
8000
7180
6353
6000
4898
3670
4000
2000
1376
570
1489
2400 2642
1658
686
234 442
0
300
4588
2912
8736
137 294 356
14560
Ruleset size
4
Performance Evolution of ODM
Performance evolution POJO RES
Sequential execution JAVA XOM
Total factor improvement
3x
9x
10x
V7.1.1.1 (CRE)
35000
30000
7x
31818
V7.5 (CRE)
29679
V8.0 (CRE)
V8.6 (DE)
25000
V8.7 (DE)
TPS
20000
15000
13723
12115
11216
12864
12643
10000
5000
1817 2309
2627
3869 4677
526 689 746
0
300
2912
8736
266 338 504
2380 2692
14560
Ruleset size
5
Characteristics of an ODM application with good
performance
• Application meets the current SLA
• Application should be ready to meet the SLA with the evolution
of rules
• The main evolutions could be:
• Increasing number of rules (~20% per year)
• Addition of new decision services on a shared Rule Execution
Server
• Changes in the structure of the decision services
6
Rule Project Design
Rule Project design
• Choose the XOM type:
• JAVA XOM
– Provide better performance and scalability.
– Now accessible with HTDS
• XML XOM easy to use
• XOM Import : Import what is necessary.
• Ex. Do not import all WAS classes if not necessary.
• BOM/VOC/B2X:
• Limit your BOM and VOC, to limit the size of the vocabulary
when you edit the rules.
• Limit the usage of “Update object state” property ( RetePlus
case)
8
Rule Project Design
• Divide your rule application in a set of rule projects with
dependencies.
• Enable Decision Validation Services before Rule Team
Server Publication.
• Ruleflow:
• With Classic Rule Engine ruleflows are interpreted
– limit the size and the complexity of the ruleflow
• With Decision Engine Ruleflows are compiled
• Limit the usage of dynamic filter in rule tasks, use static list of
rules as much of possible
• Limit the number of engine algorithms used to save memory
9
Rule Project design
• Choose the correct engine algorithm depending on your
Decision Service.
• RetePlus
– Rule chaining application
– May be useful in the case of many objects and a small number of
rules
– Performance impacted by the number of rules
• Sequential
– Application with many rules and few objects
– Really efficient in multi-thread environment.
• Fastpath (default mode in ODM 8.7)
– Application with a large number of rules and many objects
– Faster at runtime.
– Really efficient in multi-thread environment
– Much more scalable when the rule number is growing
– Optimal for Decision Table
10
Decision Engine
• Massive investment and innovation on a new rule engine:
•
•
•
•
•
•
•
•
Full rewrite of compilation and execution pipeline
Faster execution under any circumstances
Improved scalability
Far less memory consumption
Significantly reduced ruleset loading time
Designed for concurrent execution
Architecture open for extensions
Migration path trivial for the vast majority of cases
• On a next generation rule engine now called “Decision Engine”
• Compatible with the ‘classic rule engine’
11
Decision Engine benefit
• Faster ruleset Loading Time
Loading time
for sequential execution (JSE)
Java XOM - Heap 1GB
CRE
DE Intermediate code
DE Java bytecode
50
45
43
40
37
Loading time (s)
35
35
33
30
27
26
25
21 21
20
15
12 11
10
7
5
4
5
4
7
5
0.5
1.6
1.3
0.8
0.6
0.5
2.0
2.3
0
300
500
1000
2912
5824
8736
11648
14560
Ruleset size
Smaller is better
12
Decision Engine benefit
• Reduce memory usage
Minimum Heap Size (MB)
for sequential execution (JSE)
Java XOM
CRE
DE Intermediate code
DE Java bytecode
700
640
600
512
Heap Size (MB)
500
384
400
300
256
256
256
192
200
128
100
32
16
32
4
64
18
128
64
32
4
16
8
4
16
20
16
0
300
500
1000
2912
Ruleset size
5824
8736
11648
14560
Smaller is better
13
Decision Engine benefit
• Better Scalability
Average Response Time
for sequential execution
POJO RES on Java XOM (2912 rules)
V8.5.0 (CRE) vs V8.7.0 (DE Java bytecode)
V8.5.0 (CRE)
V8.7.0 (DE Java bytecode)
50
44
Average Response Time (ms)
45
40
35
30
23
25
20
15
11
10
10
8
7
6
5
4
2
1
2
4
1
1
1
1
2
1
0
1
5
10
15
20
25
Number of concurrent executions
30
60
120
Smaller is better
14
Topology choice
Topology Choices based on your objectives
• Smallest memory consumption?
JSE Rule Execution Server with Decision Engine
Rule Execution Server with Decision Engine on
Liberty
• No concurrent execution?
JSE Rule Execution Server
• Concurrent executions on distributed?
JSE Rule Execution Server
JEE Rule Execution Server
• Execute on Cloud?
Rule Service On BlueMix
16
Topology Choices based on your objectives
• Integration with JEE products?
JEE Rule Execution Server
• Call a Web Service (SOAP)?
HTDS
• Call as a RESTful?
HTDS REST XML
HTDS JSON ( Java XOM)
• Call from z/OS?
zRES
Rule Execution Server on WAS on zOS
17
Tuning of the Rule
Execution Server
Rule Execution Server best practices
• Tune the usage of the execution trace and the Decision
Warehouse by filtering Limit the size of your XOM to useful
classes
• A ruleset on an XML XOM should be configured to run in
multiple simultaneous executions by configuring the pool of XML
document drivers. This is configured with the
ruleset.xmlDocumentDriverPool.maxSize property.
• Decision Engine uses java assertions so you should check that
assertions are not enable especially when you run inside a
development environment (Eclipse)
• Use the ruleset caching information (XU dump) from the Rule
Execution Server console to diagnose the status of the internal
pools
19
Rule Execution Server best practices
• How can you minimize the performance overhead of
ruleset parsing?
• Parsing at Rule Execution Server launch or first
invocation of the ruleset. In this case, the ruleset should
be parsed before the first execution. You can force it with
a dummy execution or a call of the loadUptodateRuleset
(Management Session API).
• Update of a ruleset already in use. This can be fixed by
using the asynchronous parsing.
• A ruleset is used infrequently once a day, for example,
and removed from the pool running other rulesets. This
can be fixed by setting ruleset.maxIdleTime on this
ruleset.
• Use Decision Engine (Java bytecode) to minimize the
parsing duration
20
Performance testing
Performance testing
• The performance cost for a Decision Service may looks
something like
Execution Time
XOM
Ruleflow
Functions
B2X
Misc. Rule engine
JVM (GC)
22
Performance testing
• Spend time identifying the bottleneck in your Decision
Service.
• Is it the rule engine execution, the database or others
modules
• Recommendations for avoiding performance issues in your
rule projects include:
• Consider putting continuous performance measurement in
place to provide you with a safety net as you modify your
XOM and rules. It is much easier to see the impact of adding
a synchronized method call to the XOM, or adding a rule
with a complex join if you are receiving performance or
throughput reports every morning..
• Spend time optimizing your XOM
• Spend time getting to know the features of your profiler.
23
Take away
Take Away
•
•
•
•
Use the engine algorithm adapted to your case
Choose the topology adapted to the application type
Use Decision Engine to increase the scalability
Put performance tests in place to verify the evolution of the
application
• Leverage recent ODM and Java versions. Try to stay current on
ODM version.
25
Notices and Disclaimers
Copyright © 2015 by International Business Machines Corporation (IBM). No part of this document may be reproduced or
transmitted in any form without written permission from IBM.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with
IBM.
Information in these presentations (including information relating to products that have not yet been announced by IBM) has been
reviewed for accuracy as of the date of initial publication and could include unintentional technical or typographical errors. IBM
shall have no responsibility to update this information. THIS DOCUMENT IS DISTRIBUTED "AS IS" WITHOUT ANY WARRANTY,
EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL IBM BE LIABLE FOR ANY DAMAGE ARISING FROM THE USE OF
THIS INFORMATION, INCLUDING BUT NOT LIMITED TO, LOSS OF DATA, BUSINESS INTERRUPTION, LOSS OF PROFIT
OR LOSS OF OPPORTUNITY. IBM products and services are warranted according to the terms and conditions of the
agreements under which they are provided.
Any statements regarding IBM's future direction, intent or product plans are subject to change or withdrawal without
notice.
Performance data contained herein was generally obtained in a controlled, isolated environments. Customer examples are
presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual
performance, cost, savings or other results in other operating environments may vary.
References in this document to IBM products, programs, or services does not imply that IBM intends to make such products,
programs or services available in all countries in which IBM operates or does business.
Workshops, sessions and associated materials may have been prepared by independent session speakers, and do not
necessarily reflect the views of IBM. All materials and discussions are provided for informational purposes only, and are neither
intended to, nor shall constitute legal or other guidance or advice to any individual participant or their specific situation.
It is the customer’s responsibility to insure its own compliance with legal requirements and to obtain advice of competent legal
counsel as to the identification and interpretation of any relevant laws and regulatory requirements that may affect the customer’s
business and any actions the customer may need to take to comply with such laws. IBM does not provide legal advice or
represent or warrant that its services or products will ensure that the customer is in compliance with any law.
Notices and Disclaimers (con’t)
Information concerning non-IBM products was obtained from the suppliers of those products, their published
announcements or other publicly available sources. IBM has not tested those products in connection with this
publication and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM
products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products.
IBM does not warrant the quality of any third-party products, or the ability of any such third-party products to
interoperate with IBM’s products. IBM EXPRESSLY DISCLAIMS ALL WARRANTIES, EXPRESSED OR IMPLIED,
INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE.
The provision of the information contained herein is not intended to, and does not, grant any right or license under any
IBM patents, copyrights, trademarks or other intellectual property right.
•
IBM, the IBM logo, ibm.com, Bluemix, Blueworks Live, CICS, Clearcase, DOORS®, Enterprise Document
Management System™, Global Business Services ®, Global Technology Services ®, Information on Demand,
ILOG, Maximo®, MQIntegrator®, MQSeries®, Netcool®, OMEGAMON, OpenPower, PureAnalytics™,
PureApplication®, pureCluster™, PureCoverage®, PureData®, PureExperience®, PureFlex®, pureQuery®,
pureScale®, PureSystems®, QRadar®, Rational®, Rhapsody®, SoDA, SPSS, StoredIQ, Tivoli®, Trusteer®,
urban{code}®, Watson, WebSphere®, Worklight®, X-Force® and System z® Z/OS, are trademarks of
International Business Machines Corporation, registered in many jurisdictions worldwide. Other product and
service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on
the Web at "Copyright and trademark information" at: www.ibm.com/legal/copytrade.shtml.
Thank You
Your Feedback is
Important!
Access the InterConnect 2015
Conference CONNECT Attendee
Portal to complete your session
surveys from your smartphone,
laptop or conference kiosk.
Backup slides
How to measure the gains
• Configuration:
• Server
• Client
IBM x3550 M2 - Intel ® Xeon ® CPU X5570 @ 2.93 Ghz
2 x 4 cores x 2 threads ( 16 execution threads)
52 GB RAM.
Microsoft ® Windows® Server 2008
WebSphere Application Server 8.5.5.03(64 bit)
IBM JVM Java 7.1 SR1
JVM Heap size from 1GB to 8GB
• Rule Benchmark
•
•
•
•
•
•
Eight sizes of ruleset from 300 to 14560 rules
From 80 to 2000 rules fired per execution.
Decision tables only
Ruleflow of 5 rule tasks
Java or XML XOM
JSE, POJO (JEE), Web Service or REST invocation
30
Acronyms for this presentation
• CRE: Classic Rule Engine
• DE: Decision Engine
• RES: Rule Execution Server
• XOM: eXecutable Object Model
• HTDS: Hosted Transparent Decision Service
• As web service or REST service
31