Upload
truongkhuong
View
224
Download
5
Embed Size (px)
Citation preview
26.11.14
1
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
By the Poolside Oracle ADF Business Components Applica5on Module Pooling Explained
Frank Nimphius Senior Principal Product Manager Mobility and Development Tools November, 2014
By the poolside: ADF ApplicaMon Module Pooling Explained
2
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Program Agenda
1
2
3
4
5
Ready to dive?
Swimming 101: Basic seSngs
GeSng out of the pool: AcMvaMon and passivaMon
Cleaning the pool
For a great pool party…
By the poolside: ADF ApplicaMon Module Pooling Explained 3 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Ready to dive?
By the poolside: ADF ApplicaMon Module Pooling Explained 4
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Web ApplicaMons Are Stateless, Really? A common misconcep5on
• The HTTP protocol is stateless • State management in standard JEE web apps
– Client side (HTML hidden tag; viewstate) – Server side (ApplicaMon, Session)
By the poolside: ADF ApplicaMon Module Pooling Explained 5 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
ApplicaMon Modules A reminder
• Expose View Objects to the view layer • Define master-‐detail relaMonships between View Objects via Links • Expose client interface methods • Manage transacMons against a data source • Manage session state
By the poolside: ADF ApplicaMon Module Pooling Explained 6
26.11.14
2
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
ApplicaMon Modules Impact on scalability
By the poolside: ADF ApplicaMon Module Pooling Explained 7 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
What Is a Pool? In computer science terms
• A shared resource cache • Objects, threads, connecMons, memory • Advantages
– PreiniMalized – Standard configuraMon – Resources are reusable – Scale beyond limited resources
By the poolside: ADF ApplicaMon Module Pooling Explained 8
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
The ApplicaMon Module Pool
• Provides sessions ability to maintain VOs, EOs and their state • Exploits session “idle Mme” to reuse AMs for other sessions
– Reduces the number of objects created – Shares a limited amount of memory between sessions
• Saves AM/VO/EO state to the database as a temporary store – PassivaMon and acMvaMon
• References to AMs in the pool are for root AMs
By the poolside: ADF ApplicaMon Module Pooling Explained 9 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Swimming 101: Basic seSngs
By the poolside: ADF ApplicaMon Module Pooling Explained 10
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | By the poolside: ADF ApplicaMon Module Pooling Explained 11 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | By the poolside: ADF ApplicaMon Module Pooling Explained 12
26.11.14
3
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
ConnecMons • AMs use connecMons to allow VOs/EOs to perform queries/DML/transacMons
• Oracle recommends JDBC Data Sources over JDBC URLs – Select “JDBC DataSource” – Specify the JNDI lookup for the DataSource
• Implies the WLS ConnecMon Pool is used, not ADF BC managed ConnecMon Pool
By the poolside: ADF ApplicaMon Module Pooling Explained 13 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Enable ApplicaMon Module Pooling • jbo.ampool.doampooling • Turns on AM pooling mechanism
• “Enable Application Module Pooling” must be turned on (the default) for production systems
• Oracle will not support your application otherwise
By the poolside: ADF ApplicaMon Module Pooling Explained 14
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
SeSng Names
By the poolside: ADF ApplicaMon Module Pooling Explained 15 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
jbo.ampool.initpoolsize jbo.ampool.maxpoolsize jbo.recyclethreshold jbo.ampool.minavailablesize jbo.ampool.maxavalablesize jbo.ampool.maxinactiveage jbo.ampool.monitorsleepinterval jbo.dofailover jbo.doconnectionpooling jbo.ampool.dynamicjdbccredentials jbo.ampool.resetnontransactionalstate jbo.ampool.doampooling
By the poolside: ADF ApplicaMon Module Pooling Explained 16
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
jbo.ampool.initpoolsize jbo.ampool.maxpoolsize jbo.recyclethreshold jbo.ampool.minavailablesize jbo.ampool.maxavalablesize jbo.ampool.maxinactiveage jbo.ampool.monitorsleepinterval jbo.dofailover jbo.doconnectionpooling jbo.ampool.dynamicjdbccredentials jbo.ampool.resetnontransactionalstate jbo.ampool.doampooling
By the poolside: ADF ApplicaMon Module Pooling Explained 17 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
jbo.ampool.initpoolsize jbo.ampool.maxpoolsize jbo.recyclethreshold jbo.ampool.minavailablesize jbo.ampool.maxavalablesize jbo.ampool.maxinactiveage jbo.ampool.monitorsleepinterval jbo.dofailover jbo.doconnectionpooling jbo.ampool.dynamicjdbccredentials jbo.ampool.resetnontransactionalstate jbo.ampool.doampooling jbo.ampool.timetolive jbo.ampool.disconnect_level
By the poolside: ADF ApplicaMon Module Pooling Explained 18
26.11.14
4
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
AM Pooling Parameters
By the poolside: ADF ApplicaMon Module Pooling Explained
Pool Size Pool Performance Pool Cleanup AM Behaviour
19 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
AM Pooling Parameters
By the poolside: ADF ApplicaMon Module Pooling Explained
Pool Size Pool Performance Pool Cleanup AM Behaviour
• IniMal Pool Size jbo.ampool.initpoolsize • Maximum Pool Size jbo.ampool.maxpoolsize
20
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
jbo.ampool.initpoolsize jbo.ampool.maxpoolsize jbo.recyclethreshold jbo.ampool.minavailablesize jbo.ampool.maxavalablesize jbo.ampool.maxinactiveage jbo.ampool.monitorsleepinterval jbo.dofailover jbo.doconnectionpooling jbo.ampool.dynamicjdbccredentials jbo.ampool.resetnontransactionalstate jbo.ampool.doampooling jbo.ampool.timetolive jbo.ampool.connection_threshold
By the poolside: ADF ApplicaMon Module Pooling Explained 21 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
jbo.ampool.initpoolsize
• a.k.a. IniMal Pool Size – default 0 • On applicaMon starMng
– “Primes” AMs before they’re needed • Does not control the minimum number of AM instances
– A pool monitor sweep could reduce to zero
By the poolside: ADF ApplicaMon Module Pooling Explained 22
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
jbo.ampool.maxpoolsize
• a.k.a. Maximum Pool Size – default 4096 • Maximum amount of AM instances that can be created in the pool • Generally we leave this at the default as it is rarely reached
By the poolside: ADF ApplicaMon Module Pooling Explained 23 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
By the poolside: ADF ApplicaMon Module Pooling Explained 24
26.11.14
5
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Minimum AMs = 0 Application
Module Pool
By the poolside: ADF ApplicaMon Module Pooling Explained 25 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400 Maximum AMs = 400
Minimum AMs = 0 Application
Module Pool
By the poolside: ADF ApplicaMon Module Pooling Explained 26
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400 Maximum AMs = 400
Minimum AMs = 0 Application
Module Pool
By the poolside: ADF ApplicaMon Module Pooling Explained 27 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
By the poolside: ADF ApplicaMon Module Pooling Explained 28
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Session #1 Request
Application Module Pool
By the poolside: ADF ApplicaMon Module Pooling Explained 29 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
AM #1 Instantiated
Session #1 Request
Application Module Pool
By the poolside: ADF ApplicaMon Module Pooling Explained 30
26.11.14
6
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
AM #1 Unavailable
Session #1 Request
Application Module Pool
Session #1 Response
By the poolside: ADF ApplicaMon Module Pooling Explained 31 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
AM #1 Idle
By the poolside: ADF ApplicaMon Module Pooling Explained 32
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
AM #1 Unavailable
Session #1 Request
Application Module Pool
By the poolside: ADF ApplicaMon Module Pooling Explained 33 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
AM #1 Unavailable
Session #1 Response Session #1 Request
Application Module Pool
By the poolside: ADF ApplicaMon Module Pooling Explained 34
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
AM #1 Idle
By the poolside: ADF ApplicaMon Module Pooling Explained 35 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Session #2 Response Session #2 Request
Application Module Pool
By the poolside: ADF ApplicaMon Module Pooling Explained 36
26.11.14
7
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Session #3 Response Session #3 Request
Application Module Pool
By the poolside: ADF ApplicaMon Module Pooling Explained 37 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Session #4 Response Session #4 Request
Application Module Pool
By the poolside: ADF ApplicaMon Module Pooling Explained 38
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
By the poolside: ADF ApplicaMon Module Pooling Explained 39 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Session #400 Response Session #400 Request
By the poolside: ADF ApplicaMon Module Pooling Explained 40
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
By the poolside: ADF ApplicaMon Module Pooling Explained 41 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Session #209 Response Session #209 Request
By the poolside: ADF ApplicaMon Module Pooling Explained 42
26.11.14
8
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
By the poolside: ADF ApplicaMon Module Pooling Explained 43 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Session #4 Response Session #4 Request
By the poolside: ADF ApplicaMon Module Pooling Explained 44
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
By the poolside: ADF ApplicaMon Module Pooling Explained 45 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Session #116 Response Session #116 Request
By the poolside: ADF ApplicaMon Module Pooling Explained 46
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
By the poolside: ADF ApplicaMon Module Pooling Explained 47 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Session #401 Request
By the poolside: ADF ApplicaMon Module Pooling Explained 48
26.11.14
9
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Session #401 Request ?!
By the poolside: ADF ApplicaMon Module Pooling Explained 49 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Session #401 Request Session #400 AM
State Passivated
By the poolside: ADF ApplicaMon Module Pooling Explained 50
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Session #401 Request
Database
ps_txn
State Passivated
Session #400 AM
By the poolside: ADF ApplicaMon Module Pooling Explained 51 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Session #401 Request
Database
ps_txn
State Passivated
Session #400 AM Session
#400 AM
By the poolside: ADF ApplicaMon Module Pooling Explained 52
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Session #401 Request
Database
ps_txn
#400 AM Available
Session #400 AM
By the poolside: ADF ApplicaMon Module Pooling Explained 53 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Session #401 Request
Database
ps_txn
#400 AM Unavailable
Session #400 AM
By the poolside: ADF ApplicaMon Module Pooling Explained 54
26.11.14
10
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Session #401 Request
Database
ps_txn
Session #401 Response Session
#400 AM
By the poolside: ADF ApplicaMon Module Pooling Explained 55 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn Session #400 AM
By the poolside: ADF ApplicaMon Module Pooling Explained 56
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Session #209 Response Session #209 Request
Database
ps_txn Session #400 AM
By the poolside: ADF ApplicaMon Module Pooling Explained 57 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn Session #400 AM
By the poolside: ADF ApplicaMon Module Pooling Explained 58
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Session #4 Response Session #4 Request
Database
ps_txn Session #400 AM
By the poolside: ADF ApplicaMon Module Pooling Explained 59 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn Session #400 AM
By the poolside: ADF ApplicaMon Module Pooling Explained 60
26.11.14
11
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Session #116 Response Session #116 Request
Database
ps_txn Session #400 AM
By the poolside: ADF ApplicaMon Module Pooling Explained 61 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn Session #400 AM
By the poolside: ADF ApplicaMon Module Pooling Explained 62
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn Session #400 Request
Session #400 AM
By the poolside: ADF ApplicaMon Module Pooling Explained 63 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn Session #400 Request
State Passivated
Session #401 AM Session
#400 AM
By the poolside: ADF ApplicaMon Module Pooling Explained 64
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn Session #400 Request
State Passivated
Session #401 AM
Session #401 AM
Session #400 AM
By the poolside: ADF ApplicaMon Module Pooling Explained 65 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn Session #400 Request
Session #401 AM
Session #400 AM
#400 AM Available
By the poolside: ADF ApplicaMon Module Pooling Explained 66
26.11.14
12
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn Session #400 Request
Session #401 AM
Session #400 AM
#400 AM Available
State Activated
Session #400 AM
By the poolside: ADF ApplicaMon Module Pooling Explained 67 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn Session #400 Request
Session #401 AM
Session #400 AM
#400 AM Available
State Activated
Session #400 AM
By the poolside: ADF ApplicaMon Module Pooling Explained 68
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn Session #400 Request
Session #401 AM
#400 AM Unavailable
State Activated
Session #400 AM
Session #400 Response
By the poolside: ADF ApplicaMon Module Pooling Explained 69 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
Session #401 AM
By the poolside: ADF ApplicaMon Module Pooling Explained 70
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
Only ¼ of sessions are “active”
Session #401 AM
By the poolside: ADF ApplicaMon Module Pooling Explained 71 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
¾ of sessions are “idle”
Session #401 AM
By the poolside: ADF ApplicaMon Module Pooling Explained 72
26.11.14
13
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
AM Pooling Parameters
By the poolside: ADF ApplicaMon Module Pooling Explained
Pool Size Pool Performance Pool Cleanup AM Behaviour
• Referenced Pool Size jbo.recyclethreshold
73 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
jbo.recyclethreshold • a.k.a. Referenced Pool Size – default 10 • Most acMve AMs are pinned to memory
– Referred to as “Session Affinity” – As memory is faster, increases through put for those users
• Also pins database connecMons and reuses the relaMng JDBC prepared statement cache resulMng in faster responses
• Once we hit the “threshold” less acMve sessions are passivated – Making room for more acMve sessions
By the poolside: ADF ApplicaMon Module Pooling Explained 74
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
By the poolside: ADF ApplicaMon Module Pooling Explained 75 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
By the poolside: ADF ApplicaMon Module Pooling Explained 76
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
jbo.recyclethreshold=200
0
100
200
300
400
Application Module Pool
Database
ps_txn
Session #1 Response Session #1 Request
By the poolside: ADF ApplicaMon Module Pooling Explained 77 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
jbo.recyclethreshold=200
0
100
200
300
400
Application Module Pool
Database
ps_txn
Session #2 Response Session #2 Request
By the poolside: ADF ApplicaMon Module Pooling Explained 78
26.11.14
14
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
jbo.recyclethreshold=200
0
100
200
300
400
Application Module Pool
Database
ps_txn
Session #6 Response Session #6 Request
By the poolside: ADF ApplicaMon Module Pooling Explained 79 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
jbo.recyclethreshold=200
0
100
200
300
400
Application Module Pool
Database
ps_txn
Session #99 Response Session #99 Request
By the poolside: ADF ApplicaMon Module Pooling Explained 80
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
jbo.recyclethreshold=200
0
100
200
300
400
Application Module Pool
Database
ps_txn
By the poolside: ADF ApplicaMon Module Pooling Explained 81 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
By the poolside: ADF ApplicaMon Module Pooling Explained 82
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
By the poolside: ADF ApplicaMon Module Pooling Explained 83 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
By the poolside: ADF ApplicaMon Module Pooling Explained 84
26.11.14
15
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
By the poolside: ADF ApplicaMon Module Pooling Explained 85 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
Session #55 Response Session #55 Request
By the poolside: ADF ApplicaMon Module Pooling Explained 86
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
Session #184 Response Session #184 Request
By the poolside: ADF ApplicaMon Module Pooling Explained 87 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
Session #1 Response Session #1 Request
By the poolside: ADF ApplicaMon Module Pooling Explained 88
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
By the poolside: ADF ApplicaMon Module Pooling Explained 89 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
Session #201 Request
By the poolside: ADF ApplicaMon Module Pooling Explained 90
26.11.14
16
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
Session #201 Request
Least Recently Used AM#16
By the poolside: ADF ApplicaMon Module Pooling Explained 91 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
Session #201 Request
Session #16 AM
Session #16 AM
State Passivated
Least Recently Used AM#16
By the poolside: ADF ApplicaMon Module Pooling Explained 92
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
Session #201 Request
Session #16 AM
#16 AM Available
By the poolside: ADF ApplicaMon Module Pooling Explained 93 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
Session #201 Request Session #16 AM
#16 AM Available
By the poolside: ADF ApplicaMon Module Pooling Explained 94
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
Session #16 AM Session #201 Response
Session #201 Request
By the poolside: ADF ApplicaMon Module Pooling Explained 95 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
Session #16 AM
By the poolside: ADF ApplicaMon Module Pooling Explained 96
26.11.14
17
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
Session #16 AM
Session #111 Response Session #111 Request
By the poolside: ADF ApplicaMon Module Pooling Explained 97 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
Session #16 AM
Session #104 Response Session #104 Request
By the poolside: ADF ApplicaMon Module Pooling Explained 98
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
Session #16 AM
Session #9 Response Session #9 Request
By the poolside: ADF ApplicaMon Module Pooling Explained 99 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
Session #16 AM
Session #202 Request
By the poolside: ADF ApplicaMon Module Pooling Explained 100
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
Session #16 AM
Least Recently Used AM#46
Session #202 Request
By the poolside: ADF ApplicaMon Module Pooling Explained 101 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
Session #16 AM
Session #202 Request
Session #46 AM
State Passivated
Session #46 AM
Least Recently Used AM#46
By the poolside: ADF ApplicaMon Module Pooling Explained 102
26.11.14
18
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
Session #16 AM
Session #202 Request
Session #46 AM
#46 AM Available
By the poolside: ADF ApplicaMon Module Pooling Explained 103 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
Session #16 AM
Session #202 Request
Session #46 AM
#46 AM Available
By the poolside: ADF ApplicaMon Module Pooling Explained 104
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
Session #16 AM
Session #202 Request
Session #46 AM
#46 AM Available
By the poolside: ADF ApplicaMon Module Pooling Explained 105 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
Session #16 AM
Session #46 AM
Session #202 Response Session #202 Request
By the poolside: ADF ApplicaMon Module Pooling Explained 106
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
Session #16 AM
Session #46 AM
By the poolside: ADF ApplicaMon Module Pooling Explained 107 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
Session #16 AM
Session #46 AM
200 active sessions kept in memory
By the poolside: ADF ApplicaMon Module Pooling Explained 108
26.11.14
19
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
Session #16 AM
Session #46 AM
Less active sessions kept
out until needed
By the poolside: ADF ApplicaMon Module Pooling Explained 109 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
Session #16 AM
Session #46 AM
Memory saved
By the poolside: ADF ApplicaMon Module Pooling Explained 110
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
0
100
200
300
400
Application Module Pool
Database
ps_txn
jbo.recyclethreshold=200
Session #16 AM
Session #46 AM
Theoretical maximum users
By the poolside: ADF ApplicaMon Module Pooling Explained 111 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
GeSng out of the pool: AcMvaMon and passivaMon
By the poolside: ADF ApplicaMon Module Pooling Explained 112
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
ApplicaMon Modules Possible states
• Available – Ready for use
• Unavailable – Processing – Currently checked out to a servlet thread
• Referenced – Processing complete – Checked into pool – Pinned for a future session request
By the poolside: ADF ApplicaMon Module Pooling Explained 113 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
ApplicaMon Modules Lifecycle
New session, request received
No
Yes Is there an available
AM in the pool?
Is the pool below the threshold?
Yes Instantiate an AM,
AM = Available
Checkout AM, AM = Unavailable
No
Continuing processing the
request/response
To be defined
By the poolside: ADF ApplicaMon Module Pooling Explained 114
26.11.14
20
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
ApplicaMon Modules Lifecycle
New session, request received
No
Yes Is there an available
AM in the pool?
Is the pool below the threshold?
Yes Instantiate an AM,
AM = Available
Checkout AM, AM = Unavailable
No
Continuing processing the
request/response
Passivation?
By the poolside: ADF ApplicaMon Module Pooling Explained 115 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
PassivaMon When does it happen?
• If a request from a new session is received… • … And total AMs >= jbo.recyclethreshold … • … And all the AMs in the pool are in the referenced state
– The more LRU “referenced” AM is a candidate for passivaMon
By the poolside: ADF ApplicaMon Module Pooling Explained 116
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
PassivaMon What is it?
• ADF persists the AM state to a store • Steps
1. Retrieve all state associated to the AM instance 2. Convert the state into XML 3. Write the XML to the persistence store 4. (CondiMonally) Mark AM as available
• AcMvaMon reverses the process – PassivaMon record in persistence store cleared
By the poolside: ADF ApplicaMon Module Pooling Explained 117 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
PassivaMon What is persisted?
• TransacMonal -‐ new, modified and deleted enMMes • Non-‐transacMonal -‐ for each acMve view object
– Current row indicator – New rows and their posiMon – ViewCriteria and parameters – Flag indicaMng whether the row set had been executed – Range start and size – Access mode – Fetch mode and size – Any view object custom data – Transient view object arributes (if configured to do so) – Select, from, where and order by clauses (if created dynamically)
By the poolside: ADF ApplicaMon Module Pooling Explained 118
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
PassivaMon Persistence store op5ons
• File – Faster, since no DB roundtrip involved – More suitable for single node deployments without failover
• Database – Slower, since requires DB roundtrip – Standard seSng is to use the AM connecMon – AutomaMcally creates and uses the ps_txn table and the ps_txn_seq sequence – Recommended approach to support failover in a cluster
By the poolside: ADF ApplicaMon Module Pooling Explained 119 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
PassivaMon Performance impact
• AcMvaMon / PassivaMon enhances applicaMon scalability but… • I/O overhead impacts average session throughput
– The most acMve sessions are not impacted – Performance will degrade if the referenced pool is too small
• High number of check ins / check outs indicates either – Heavy load – Inadequate value for jbo.recyclethreshold
By the poolside: ADF ApplicaMon Module Pooling Explained 120
26.11.14
21
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Cleaning the pool
By the poolside: ADF ApplicaMon Module Pooling Explained 121 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Maxpoolsize vs recyclethreshold
• jbo.ampool.maxpoolsize can be set above jbo.recyclethreshold • Useful for heavy load scenarios • Pool will instanMate new AMs unMl
– jbo.ampool.maxpoolsize is reached – Or the server runs out of memory – Or an AM is checked into the pool as referenced or available – Or user sessions end or Mme out
By the poolside: ADF ApplicaMon Module Pooling Explained 122
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Maxpoolsize vs recyclethreshold In other words…
if (all AMs up to the threshold are currently unavailable) then allocateAMAboveThreshold else passivateAnAMAndUseSpaceBelowRecycleThreshold endif;
By the poolside: ADF ApplicaMon Module Pooling Explained 123 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
AM Pooling Parameters
By the poolside: ADF ApplicaMon Module Pooling Explained
Pool Size Pool Performance Pool Cleanup AM Behaviour
• Pool Polling Interval jbo.ampool.monitorsleepinterval • Idle Instance Timeout jbo.ampool.maxinacMveage • Maximum Instance Time to Live jbo.ampool.Mmetolive • Maximum Available Size jbo.ampool.maxavailablesize • Minimum Available Size jbo.ampool.minavailablesize
124
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
jbo.ampool.monitorsleepinterval a.k.a. Pooling Interval • default: 600 seconds (600000 ms) • Defines how osen to sweep the AM pool to reclaim AMs • Designed to shrink the pool to either:
– jbo.ampool.minavailablesize under light load – jbo.ampool.maxavailablesize under heavy load
• Implements 2 strategies in reclaiming AMs relaMng to – jbo.ampool.maxinacMveage – jbo.ampool.Mmetolive
By the poolside: ADF ApplicaMon Module Pooling Explained 125 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
jbo.ampool.maxinacMveage
• AMs are reclaimed when: – They have been idle/unused greater than jbo.ampool.maxinacMveage – Default: 600 seconds (600000 ms) – But not less than total number of AMs = jbo.ampool.maxavailablesize
• If system is under heavy load
– But not less than total number of AMs = jbo.ampool.minavailablesize • If system is under light load
By the poolside: ADF ApplicaMon Module Pooling Explained 126
26.11.14
22
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
jbo.ampool.Mmetolive
• Or AMs are reclaimed when: – They have been idle/unused greater than jbo.ampool.Mmetolive – Default: 60 minutes (3600000 ms) – Regardless if total number of AMs is <= jbo.ampool.minavailablesize
• RecommendaMon: – Set to -‐1 (turns the feature off)
By the poolside: ADF ApplicaMon Module Pooling Explained 127 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
AM Pooling Parameters
By the poolside: ADF ApplicaMon Module Pooling Explained
Pool Size Pool Performance Pool Cleanup AM Behaviour
• Enable ApplicaMon Module Pooling jbo.ampool.doampooling
• Failover TransacMon State Upon Managed Release jbo.dofailover
• Disconnect ApplicaMon Module Upon Release jbo.doconnecMonpooling
• Reset Non-‐TransacMon State Upon Managed Release jbo.ampool.resetnontransacMonalstate
• (Disconnect Level) jbo.ampool.disconnect_level
128
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
For a great poolside party…
By the poolside: ADF ApplicaMon Module Pooling Explained 129 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Our advice
• Never keep the default seSngs for the AM Pool • Choose iniMal values that make sense
– According to past and/or projected usage parerns – Take CPU and memory resources into account
• Always have a lifeguard on hand – Be proacMve and monitor your producMon applicaMons – Tweak the seSngs accordingly
By the poolside: ADF ApplicaMon Module Pooling Explained 130
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Dive deeper A 2h ADF Insider series – by Chris Muir
By the poolside: ADF ApplicaMon Module Pooling Explained 131
bit.ly/bythepoolside Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Treffen der Deutschen ADF Community Warum Ø Neuigkeiten zu Oracle ADF erfahren Ø Mit Product Managern und Experten sprechen Ø Networking, Austausch Ø und Mitgestalten
Wo Raum Kopenhagen
Wann Mirwoch, 19. Nov., 17.00 – 17.45 Uhr