Академический Документы
Профессиональный Документы
Культура Документы
Contents
LOAD & PERFORMANCE TESTING .................................................... ERROR! BOOKMARK NOT DEFINED.
1 STRESS, LOAD, SOAK, SPIKE TESTS LOAD PROFILES ........................................ ERROR! BOOKMARK NOT DEFINED.
2 LNP TESTING LIFE CYCLE.......................................................................... ERROR! BOOKMARK NOT DEFINED.
3 EXAMPLES OF LNP TESTING OBJECTIVES ...................................................... ERROR! BOOKMARK NOT DEFINED.
3.1 RESPONSE TIME......................................................................................... ERROR! BOOKMARK NOT DEFINED.
3.2 RELIABILITY............................................................................................... ERROR! BOOKMARK NOT DEFINED.
3.3 CONFIGURATION SIZING .............................................................................. ERROR! BOOKMARK NOT DEFINED.
3.4 CAPACITY PLANNING .................................................................................. ERROR! BOOKMARK NOT DEFINED.
3.5 REGRESSION ............................................................................................. ERROR! BOOKMARK NOT DEFINED.
3.6 BOTTLENECK IDENTIFICATION ...................................................................... ERROR! BOOKMARK NOT DEFINED.
3.7 SCALABILITY .............................................................................................. ERROR! BOOKMARK NOT DEFINED.
BPEL PM: INTRODUCTION ............................................................... ERROR! BOOKMARK NOT DEFINED.
1 BPEL PM PROCESS TYPES ....................................................................... ERROR! BOOKMARK NOT DEFINED.
1.1 BY INTERFACE ........................................................................................... ERROR! BOOKMARK NOT DEFINED.
1.2 BY DURABILITY .......................................................................................... ERROR! BOOKMARK NOT DEFINED.
2 TERMINOLOGY ...................................................................................... ERROR! BOOKMARK NOT DEFINED.
3 DIFFERENCE BETWEEN ASYNC & SYNC BPEL .............................................. ERROR! BOOKMARK NOT DEFINED.
4 SOA 11G CONFIGURATION FILES AND LOG FILES LOCATION ............................. ERROR! BOOKMARK NOT DEFINED.
5 DEFAULT DATA SOURCES ......................................................................... ERROR! BOOKMARK NOT DEFINED.
6 PERFORMANCE OBJECTIVE ....................................................................... ERROR! BOOKMARK NOT DEFINED.
7 WHAT TO TUNE .................................................................................... ERROR! BOOKMARK NOT DEFINED.
8 SYSTEM SETUP ...................................................................................... ERROR! BOOKMARK NOT DEFINED.
9 IMPORTANT POINTS ............................................................................... ERROR! BOOKMARK NOT DEFINED.
10 REFERENCE......................................................................................... ERROR! BOOKMARK NOT DEFINED.
JVM TUNING ................................................................................... ERROR! BOOKMARK NOT DEFINED.
1 PAUSE TIMES AND THROUGHPUT .............................................................. ERROR! BOOKMARK NOT DEFINED.
1.1 GARBAGE COLLECTION VS. THROUGHPUT ...................................................... ERROR! BOOKMARK NOT DEFINED.
1.2 DEFRAGMENTATION PAUSES AND THROUGHPUT ............................................ ERROR! BOOKMARK NOT DEFINED.
2 PERFORMANCE AND MEMORY FOOTPRINT .................................................. ERROR! BOOKMARK NOT DEFINED.
3 JVM CHOICE ........................................................................................ ERROR! BOOKMARK NOT DEFINED.
4 JROCKITS TUNING ................................................................................. ERROR! BOOKMARK NOT DEFINED.
4.1 BOARDING INTO SHIP STEP 1 .................................................................... ERROR! BOOKMARK NOT DEFINED.
4.1.1 Heap Size ............................................................................................ Error! Bookmark not defined.
4.1.2 Garbage Collection............................................................................. Error! Bookmark not defined.
4.1.3 Nursery Size ...................................................................................... Error! Bookmark not defined.
APPENDIX F: ORA-01438: VALUE LARGER THAN SPECIFIED PRECISION ALLOWED .... ERROR! BOOKMARK
NOT DEFINED.
5
6
7
8
APPENDIX G: LOBS IN THE SOAINFRA SCHEMA ................................ ERROR! BOOKMARK NOT DEFINED.
APPENDIX H: AWR, ADDM, & ASH REPORTS .................................... ERROR! BOOKMARK NOT DEFINED.
1 AWR REPORT ...................................................................................... ERROR! BOOKMARK NOT DEFINED.
2 ADDM REPORT .................................................................................... ERROR! BOOKMARK NOT DEFINED.
3 ASH REPORT ........................................................................................ ERROR! BOOKMARK NOT DEFINED.
4 AWR REPORT ANALYSIS ......................................................................... ERROR! BOOKMARK NOT DEFINED.
4.1 SQL STATEMENTS ORDERED BY ELAPSED TIME ............................................... ERROR! BOOKMARK NOT DEFINED.
4.2 SQL STATEMENTS ORDERED BY CPU TIME..................................................... ERROR! BOOKMARK NOT DEFINED.
4.3 SQL STATEMENTS ORDERED BY GETS ............................................................ ERROR! BOOKMARK NOT DEFINED.
4.4 SQL STATEMENTS ORDERED BY READS .......................................................... ERROR! BOOKMARK NOT DEFINED.
4.5 SQL STATEMENTS ORDERED BY EXECUTIONS .................................................. ERROR! BOOKMARK NOT DEFINED.
4.6 SQL STATEMENTS ORDERED BY PARSE CALLS ................................................. ERROR! BOOKMARK NOT DEFINED.
5 REFERENCE .......................................................................................... ERROR! BOOKMARK NOT DEFINED.
APPENDIX I: MONITORING SCRIPTS ................................................. ERROR! BOOKMARK NOT DEFINED.
1 DATABASE MONITORING ......................................................................... ERROR! BOOKMARK NOT DEFINED.
2 JMS MONITORING ................................................................................ ERROR! BOOKMARK NOT DEFINED.
3 AQ MONITORING .................................................................................. ERROR! BOOKMARK NOT DEFINED.
APPENDIX J: HOW TO MONITOR SOA SERVER MEMORY USAGE ....... ERROR! BOOKMARK NOT DEFINED.
1
2
3
4
APPENDIX K: HEAP DUMP FILES ANALYSIS: JROCKIT AND HOTSPOT JVMS ....... ERROR! BOOKMARK NOT
DEFINED.
1 EXAMPLE ANALYSIS OF A HEAP DUMP FILE USING ECLIPSE MEMORY ANALYZER ... ERROR! BOOKMARK NOT DEFINED.
2 REFERENCE .......................................................................................... ERROR! BOOKMARK NOT DEFINED.
APPENDIX L: CAPACITY PLANNING................................................... ERROR! BOOKMARK NOT DEFINED.
Exhibits
Exhibit 1: Stress, Load, Soak, Spike Tests Load Profiles ................... Error! Bookmark not defined.
Exhibit 2: LnP Testing Life Cycle and SDLC ....................................... Error! Bookmark not defined.
Exhibit 3: BPEL Processes ................................................................. Error! Bookmark not defined.
Exhibit 4: JVM Tuning Tradeoffs ...................................................... Error! Bookmark not defined.
Exhibit 5: JVM's Garbage Collection and Throughput ..................... Error! Bookmark not defined.
Exhibit 6: jRockit Attributes ............................................................. Error! Bookmark not defined.
Exhibit 7: HostSpot Attributes ......................................................... Error! Bookmark not defined.
Exhibit 8: WLS internal applications at startup - 1 ...................................................................... 16
Exhibit 9: WLS internal applications at startup - 2 ...................................................................... 16
Exhibit 10: WLS internal applications at startup - 3 .................................................................... 17
Exhibit 11: WLS internal applications at startup - 4 ..................................................................... 18
Exhibit 12: WLS internal applications at startup - 5 ..................................................................... 19
Exhibit 13: WLS internal applications at startup - 6 ..................................................................... 20
Exhibit 14: SOAWorkManager - 1 ................................................................................................. 27
Exhibit 15: SOAWorkManager - 2 ................................................................................................. 27
Exhibit 16: SOAWorkManager - 3 ................................................................................................. 27
Exhibit 17: WLS Muxers ................................................................................................................ 29
Exhibit 18: FMC Login....................................................................... Error! Bookmark not defined.
Exhibit 19: FMC Farm Summary....................................................... Error! Bookmark not defined.
Exhibit 20: FMC Performance Summary - 1 ..................................... Error! Bookmark not defined.
Exhibit 21: FMC Performance Summary - 2 ..................................... Error! Bookmark not defined.
Exhibit 22: FMC Performance Summary - 3 ..................................... Error! Bookmark not defined.
Exhibit 23: Dynamic Memory Service .............................................. Error! Bookmark not defined.
Exhibit 24: BPEL Engine Threading Model ....................................... Error! Bookmark not defined.
Exhibit 25: Dispatcher Maximum Request Depth - 1....................... Error! Bookmark not defined.
Exhibit 26: Dispatcher Maximum Request Depth - 2....................... Error! Bookmark not defined.
Exhibit 27: InvokeMessages In Cache .............................................. Error! Bookmark not defined.
Exhibit 28: syncMaxWaitTime - 1 .................................................... Error! Bookmark not defined.
Exhibit 29: syncMaxWaitTime - 2 .................................................... Error! Bookmark not defined.
Exhibit 30: syncMaxWaitTime - 3 .................................................... Error! Bookmark not defined.
Exhibit 31: syncMaxWaitTime 4 .................................................... Error! Bookmark not defined.
Exhibit 32: BPEL EJBs - 1 ................................................................... Error! Bookmark not defined.
10
12
Snippets
Snippet 1: Sample Work Manager - 1 ........................................................................................... 23
Snippet 2: Sample Work Manager - 2 ........................................................................................... 25
Snippet 3: Sample config.xml........................................................................................................ 26
Snippet 4: Sample startWeblogic.sh ............................................................................................. 26
Snippet 5: Using setNull In a Prepared Statement ....................................................................... 32
Snippet 6: Sample thread waiting for DB Call to finish................................................................. 39
Snippet 7: composite.xml ................................................................ Error! Bookmark not defined.
Snippet 8: Drop Histrogram ............................................................. Error! Bookmark not defined.
Snippet 9: Set Table Preferences ..................................................... Error! Bookmark not defined.
Snippet 10: Single Threaded Model - jca file ................................... Error! Bookmark not defined.
Snippet 11: Partitioned Threaded Model - jca file........................... Error! Bookmark not defined.
Snippet 12: Tuning number of files to be processed at a time ....... Error! Bookmark not defined.
Snippet 13: JMS Adapter - Receive Thread - composite.xml ........... Error! Bookmark not defined.
Snippet 14: AQ Adapter - Dequeue Threads - composite.xml......... Error! Bookmark not defined.
Snippet 15: common properties schema - 1.................................... Error! Bookmark not defined.
Snippet 16: common properties schema - 2.................................... Error! Bookmark not defined.
Snippet 17: bpel.xml ........................................................................ Error! Bookmark not defined.
Snippet 18: composite.xml .............................................................. Error! Bookmark not defined.
Snippet 19: SecureFiles .................................................................... Error! Bookmark not defined.
Snippet 20: BasicFiles to SecureFiles ............................................... Error! Bookmark not defined.
13
Tables
Table 1: AuditLevel........................................................................... Error! Bookmark not defined.
Table 2: BPEL Engine - AuditLevel .................................................... Error! Bookmark not defined.
Table 3: AuditStorePolicy ................................................................. Error! Bookmark not defined.
Table 4: SOA Schemas ...................................................................... Error! Bookmark not defined.
Table 5: SOAINFRA Tables ................................................................ Error! Bookmark not defined.
Table 6: MDS Schema tables............................................................ Error! Bookmark not defined.
Table 7: CUBE_INSTANCE................................................................. Error! Bookmark not defined.
Table 8: CUBE_SCOPE ...................................................................... Error! Bookmark not defined.
Table 9: COMPOSITE_INSTANCE ...................................................... Error! Bookmark not defined.
Table 10: COMPOSITE_INSTANCE_FAULT ....................................... Error! Bookmark not defined.
Table 11: AUDIT_TRAIL .................................................................... Error! Bookmark not defined.
Table 12: AUDIT_DETAILS ................................................................ Error! Bookmark not defined.
Table 13: DLV_MESSAGE ................................................................. Error! Bookmark not defined.
Table 14: DLV_SUBSCRIPTION ......................................................... Error! Bookmark not defined.
Table 15: DOCUMENT_CI_REF ......................................................... Error! Bookmark not defined.
Table 16: DOCUMENT_DLV_MSG_REF ............................................ Error! Bookmark not defined.
Table 17: WORK_ITEM ..................................................................... Error! Bookmark not defined.
Table 18: XML_DOCUMENT ............................................................. Error! Bookmark not defined.
Table 19: XML_DOCUMENT_REF ..................................................... Error! Bookmark not defined.
Table 20: HEADERS_PROPERTIES ..................................................... Error! Bookmark not defined.
Table 21: CLUSTER_MASTER ............................................................ Error! Bookmark not defined.
Table 22: CLUSTER_NODE ................................................................ Error! Bookmark not defined.
Table 23: Partial Partitioning ........................................................... Error! Bookmark not defined.
Table 24: Complete Partitioning ...................................................... Error! Bookmark not defined.
Table 25: MDS_NAMESAPCES.......................................................... Error! Bookmark not defined.
Table 26: MDS_PARTITIONS ............................................................ Error! Bookmark not defined.
Table 27: MDS_PATHS ..................................................................... Error! Bookmark not defined.
Table 28: File & FTP Adapter - Inbound Throttling .......................... Error! Bookmark not defined.
Table 29: : File & FTP Adapter - Outbound Throttling ..................... Error! Bookmark not defined.
Table 30: : File & FTP Adapter - Outbound Best Practices............... Error! Bookmark not defined.
Table 31: completionPersistPolicy property .................................... Error! Bookmark not defined.
Table 32: validateSchema value ...................................................... Error! Bookmark not defined.
Table 33: Idempotency value........................................................... Error! Bookmark not defined.
Table 34: nonBlockingInvoke value ................................................ Error! Bookmark not defined.
Table 35: Database initialization parameters .................................. Error! Bookmark not defined.
Table 36: Contention tables ............................................................. Error! Bookmark not defined.
Table 37: Tables under potential of index contention .................... Error! Bookmark not defined.
14
<<MW_HOME>>\<<user_projects>>\domain\<<domain-name>>\startWebLogic.sh
OR
<<MW_HOME>>\<<user_projects>>\domain\<<domain-name>>\bin\startWebLogic.sh
Where MW_HOME is the Middleware Home directory containing the Oracle product installation,
and domain-name is the name of the domain directory defined by the selected configuration
template.
In startWebLogic.sh file one can set JVM parameters, Java version and few more parameters
pertaining to WLS.
While starting a managed server (in which BPEL engine is deployed) make sure
that it is in production mode.
WLS deploys many internal applications during startup. Many of these internal applications are
not needed by BPEL Engine. WLS can be configured to wait and deploy these applications on
the first access (on-demand) instead of always deploying them during server startup. This can
conserve memory and CPU time during deployment as well as improving startup time and
decreasing the base memory footprint for the server.
For a development domain, the default is for WLS to deploy internal applications (console, uddi,
wlstestclient, and uddiexplorer) on-demand. For a production-mode domain, the default is for
WLS to deploy internal applications as part of server startup.
15
Click on one of the domain, e.g. myManagedDomain, in the left navigation bar in the
WLS console.
16
17
18
19
1. Thread Management
a. Default Thread Pool
b. SOAWorkManager
2. Network I/O
a. Muxers
b. Chunk Parameters
c. Connection Backlog Buffering
d. Cached Connections
3. Database related
a. Connection Pool
b. Transactions
c. Data Source
Enabling of on-demand deployment of internal applications will conserve
memory and CPU cycles during deployment as well as improving startup time
and decreasing the base memory footprint for the server.
There is difference between the general thread pool and the work managers. The general
thread pool represents the number of threads allocated for the server. Work Managers are
dedicated to applications.
WLS Administrator can configure a set of thread usage guidelines and associate them with one
or more applications, or with particular application components. For example, one can
associate one set of scheduling guidelines for one application, and another set of guidelines for
other application. At run-time, WLS uses these guidelines to assign pending work and enqueued
requests to execution threads.
21
process requests.
For example, assume that WLS is running two modules. The Work Manager for ModuleA
specifies a fair-share-request-class of 80 and the Work Manager for ModuleB
specifies a fair-share-request-class of 20.
During a period of sufficient demand, with a steady stream of requests for each module
such that the number requests exceed the number of threads; WLS will allocate 80%
and 20% of the thread-usage time to ModuleA and ModuleB respectively.
Note: The value of a fair share request class is specified as a relative value, not a
percentage. Therefore, in the above example, if the request classes were defined as 400
and 100, they would still have the same relative values.
requests exceed the number of threads, and no think time delays between response
and request, WLS will schedule requests for ModuleA and ModuleB to keep the average
response time in the ratio 2:5. The actual average response times for ModuleA and
ModuleB might be higher or lower than the response time goals, but WLS will strive to
keep ratio of target 2:5. For example, if the average response time for ModuleA
requests is 1,000 ms, then average response time for ModuleB requests will be
approximate 2,500 ms.
based on context information, such as the current user or the current users group.
For example, context-request-class assigns a request class to requests based on the
value of the requests subject and role properties.
A context request class defines request classes in an applications deployment
descriptor based on a users context. For example:
<work-manager>
<name>responsetime_workmanager</name>
<response-time-request-class>
<name>my_response_time</name>
<goal-ms>2000</goal-ms>
</response-time-request-class>
</work-manager>
<work-manager>
<name>context_workmanager</name>
<context-request-class>
<name>test_context</name>
<context-case>
<user-name>system</user-name>
<request-class-name>high_fairshare</request-class-name>
</context-case>
<context-case>
<group-name>everyone</group-name>
<request-class-name>low_fairshare</request-class-name>
</context-case>
</context-request-class>
</work-manager>
Snippet 1: Sample Work Manager - 1
Above, as explained the request classes based on fair share and response time by relating the
scheduling to other work using the same request class. A mix of fair share and response time
request classes is scheduled with a marked bias in favor of response time scheduling.
23
1.2 Constraints
A constraint defines minimum and maximum numbers of threads allocated to execute requests
and the total number of requests that can be queued or executing before WLS begins rejecting
requests.
One can define the following types of constraints:
constraint causes the server to reject requests only when it has reached its
capacity. The default is -1. Note that the capacity includes all requests, queued or
executing, from the constrained work set. Work is rejected either when an individual
capacity threshold is exceeded or if the global capacity is exceeded. This constraint is
independent of the global queue threshold.
Capacity
In response to stuck threads, one can define a Stuck Thread Work Manager component
that can shut down the Work Manager, move the application into admin mode, or mark
the server instance as failed.
For instance, the Work Manager defined in Listing 2.2 shuts down the Work Manager
when two threads are stuck for longer than 30 seconds.
24
<work-manager>
<name>stuckthread_workmanager</name>
<work-manager-shutdown-trigger>
<max-stuck-thread-time>30</max-stuck-thread-time>
<stuck-thread-count>2</stuck-thread-count>
</work-manager-shutdown-trigger>
</work-manager>
Snippet 2: Sample Work Manager - 2
One can override the behavior of the default Work Manager by creating and configuring a
global Work Manager called default. This allows one to control the default thread-handling
behavior of WLS.
The configuration of work manager is done in one of the following configuration files:
25
min>
<self-tuning-thread-pool-size-max>200</self-tuning-thread-pool-sizemax>
[...]
</server>
Snippet 3: Sample config.xml
# START WEBLOGIC
echo "starting weblogic with Java version:"
${JAVA_HOME}/bin/java ${JAVA_VM} -version
if [ "${WLS_REDIRECT_LOG}" = "" ] ; then
echo "Starting WLS with line:"
${JAVA_HOME}/bin/java ${JAVA_VM} ${MEM_ARGS} Dweblogic.threadpool.MinPoolSize=150 -Dweblogic.Name=${SERVER_NAME} Djava.security.policy=${WL_HOME}/server/lib/weblogic.policy
${JAVA_OPTIONS} ${PROXY_SETTINGS} ${SERVER_CLASS}
else
echo "Redirecting output from WLS window to
${WLS_REDIRECT_LOG}"
${JAVA_HOME}/bin/java ${JAVA_VM} ${MEM_ARGS} Dweblogic.Name=${SERVER_NAME} Djava.security.policy=${WL_HOME}/server/lib/weblogic.policy
${JAVA_OPTIONS} ${PROXY_SETTINGS} ${SERVER_CLASS}
>"${WLS_REDIRECT_LOG}" 2>&1fi
Snippet 4: Sample startWeblogic.sh
As a good practice, set a higher than default "minimal value" for the thread pool
but no maximal value, let WLS allow to sort it out by itself.
1.3.2 SOAWorkManager
With the deployment of BPEL Engine in WLS, a work manager (wm/SOAWorkManager) gets
created. This work manager is type of Global Work manager.
26
Exhibit 7: SOAWorkManager - 1
SOAWorkManager is essentially empty Work Manger targeted to a specific cluster (all servers in
cluster).
Exhibit 8: SOAWorkManager - 2
Exhibit 9: SOAWorkManager - 3
27
For the purpose of tuning of BPEL engine, one needs to focus on SOAWorkManager
Worker Manager.
2 Network I/O
2.1 Muxers
WLS uses software modules called muxers to read incoming requests on the server and
incoming responses on the client. WLS supports the following muxers:
Java Muxer
Native Muxers
Non-Blocking IO Muxer
If NativeIOEnabled is false and MuxerClass is null, the Java Socket Muxer is used.
If NativeIOEnabled is true and MuxerClass is null, native muxers are used, if available
for platform.
If the Muxer Class attribute is set to weblogic.socket.NIOSocketMuxer or Dweblogic.MuxerClass=weblogic.socket.NIOSocketMuxer flag is set, the NonBlocking IO Muxer is used.
Java Muxer blocks on reads until there is data to be read from a socket. This behavior does not
scale well when there are a large number of sockets and/or when data arrives infrequently at
sockets. This is typically not an issue for clients, but it can create a huge bottleneck for a server.
If the Enable Native IO parameter is not selected, the server instance exclusively
uses the Java Muxer. This might be acceptable if there are a small number of
clients and the rate at which requests arrive at the server is fairly high.
28
Under these conditions, the Java muxer performs as well as it eliminates Java Native Interface
(JNI) overhead. Unlike native muxers, the number of threads used to read requests is not fixed
and is tunable for Java muxers by configuring the Percent Socket Readers parameter setting
in the Administration Console.
Ideally, one should configure this parameter so the number of threads roughly equals the
number of remote concurrently connected clients up to 50% of the total thread pool size. Each
thread waits for a fixed amount of time for data to become available at a socket. If no data
arrives, the thread moves to the next socket.
Native muxers use platform-specific native binaries to read data from sockets. Native muxers
provide superior scalability because they implement a non-blocking thread model. When a
native muxer is used, the server creates a fixed number of threads dedicated to reading
incoming requests. One must ensure that to use Native I/O, the native library must be present
in the servers shared library path. This is set up with the default scripts. When the server does
not find the native library, it throws an error java.lang.UnsatisfiedLinkError: no muxer
in java.library.path and then loads the Java version of the muxer.
WLS also provides a non-blocking IO implementation of Native Muxers which may provide
enhanced performance for certain load scenarios.
On several platforms, WLS has performance packs. One of the major components
of performance pack is native muxer implementation. Naturally, with performance
pack, WLS performance improves dramatically if used with Native Muxers.
29
A chunk is a unit of memory that the WLS network layer, both on the client and server side,
uses to read data from and write data to sockets. To reduce memory allocation costs, a server
instance maintains a pool of these chunks. For applications that handle large amounts of data
per request, increasing the value on both the client and server sides can boost performance.
The default chunk size is about 4K. Use the following properties to tune the chunk size and the
chunk pool size:
weblogic.Chunksize: Sets the size of a chunk (in bytes). The primary situation in which this
may need to be increased is if request sizes are large. It should be set to values that are
multiples of the network's maximum transfer unit (MTU), after subtracting from the value any
Ethernet or TCP header sizes. Set this parameter to the same value on the client and server.
weblogic.utils.io.chunkpoolsize: Sets the maximum size of the chunk pool. The default
value is 2048. The value may need to be increased if the server starts to allocate and discard
chunks in steady state. To determine if the value needs to be increased, monitor the CPU
profile or use a memory/ heap profiler for call stacks invoking the constructor
weblogic.utils.io.Chunk.
weblogic.PartitionSize: Sets the number of pool partitions used (default is 4). The chunk pool
can be a source of significant lock contention as each request to access to the pool must be
synchronized. Partitioning the thread pool spreads the potential for contention over more than
one partition.
Fixed
LRU: As name suggest, LRU caches least recently used statements used on the collection until
the statement cache size is reached. When an application calls Conn.prepareStatement(), WLS
checks to see if the statement is stored in the statement cache. If so, WLS returns the cached
statement. If the statement is not in the cache, and the cache is full (number of statements in
the cache = statement cache size), WLS determines which existing statement in the cache was
the least recently used and replaces that statement in the cache with the new statement.
Fixed: As name suggest FIXED algorithm enables WLS to cache first (till statement cache size is
reached) statements used on the connection. Statements used after the statement cache size is
reached are not cached.
LRU algorithm is preferred because rarely used statements will eventually be
replaced in the cache with frequently used statements.
For example:
31
Automatic testing: In this case health check and maintenance responsibility is delegated
to WLS.
Manual testing: In this case application code is responsible for health check and
maintenance.
Seconds to Trust an Idle Pool Connection: This option specifies the number of seconds
after a connection has been proven to be OK to be trusted by WLS as OK and skip automatic
testing.
The duration selected for Seconds to Trust an Idle Pool Connection presents
performance optimization opportunity.
call in a socket read that the JVM will be unable to break until the OS TCP limit is hit (typically
10 minutes). If a pool disables itself in this manner, it will periodically try to reconnect to the
RDBMS (every 5 seconds by default). Once a new connection can be made, the pool will reenable itself, and subsequent connection requests will be served as normal (with the pool
repopulating itself as load requires).
Note: Even one is using automatic testing and relying on WLS for connections health,
applications must not assume healthy connection in all cases and handle the exceptions that
may arise due to unhealthy/faulty connections.
Waiting for Connection attribute, which limits the number connection requests that can
Minimum Value: 0
Maximum Value: 2147483647
35
execute. If query execution consume more than the time specified, JDBC driver will throw an
exception.
The default value for Statement Timeout is -1 which means SQL query will not time out due to
longer execution duration.
Setting up value of Statement Timeout in high volume transaction scenario is
performance booster at the cost of increased risk of failure of SQL queries.
the greater of either the initial capacity or the number of connections reserved from the
connection pool.
Shrinking does not apply to connection pools because connections are never returned
to the connection pool. Effectively, they are always reserved.
When a connection pool is Reset, the reset connections from the connection pool are
marked as Test Needed. The next time each connection is reserved, WLS tests the
connection and recreates it if necessary. Connections are not tested synchronously
when one reset the connection pool. This feature requires that Test Connections on
Reserve is enabled and a Test Table Name or query is specified.
36
3.9 GridLink
GridLink is data source implementation targeted to Oracle RAC cluster. It responds to FAN
events to provide Fast Connection Failover (FCF), Runtime Connection Load-Balancing (RCLB),
and RAC instance graceful shutdown. XA affinity is supported at the global transaction Id level.
A GridLink data source uses Fast Connection Failover to:
GridLink data sources use runtime connection load balancing to distribute connections to
Oracle RAC instances based on Oracle FAN events issued by the database. This simplifies data
37
source configuration and improves performance as the database drives load balancing of
connections through the GridLink data source, independent of the database topology. Runtime
Connection Load Balancing allows WLS to:
Adjust the distribution of work based on back end node capacities such as CPU,
availability, and response time
React to changes in Oracle RAC topology
Manage pooled connections for high performance and scalability
Where rdbms-scan is the scan of the database cluster, the scan-port is the port of the scan
listeners; the service-name is the service name that is used for connection to the database.
JDBC LLR generally improves performance of two-phase transactions that involve SQL
updates, deletes, or inserts.
LLR generally reduces the performance of two-phase transactions where all SQL
operations are read-only (just selects).
Consider using LLR instead of the less safe "last-agent" optimization for connectors, and
the less safe "emulate-two-phase-commit" option for JDBC connection pools (formerly
known as the "enable two-phase commit" option for pools that use non-XA drivers).
On Oracle databases, heavily used LLR tables may become fragmented over time, which
can lead to unused extents. This is likely due to the highly transient nature of the LLR
table's data. To help avoid the issue, set PCT_FREE to 5 and PCT_USED to 95 on the LLR
38
4 Database Mode
There are two modes of database connections: Shared and Dedicated. Database in shared
mode may be slower and no information will be available AWR report. Threads will be waiting
for the database calls to finish.
Sample thread waiting for DB Call to finish:
"[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (selftuning)'" id=68 idx=0x130 tid=3996 prio=5 alive, in native, daemon
at
jrockit/net/SocketNativeIO.readBytesPinned(Ljava/io/FileDescriptor;[BIII)I(Na
tive Method)
at jrockit/net/SocketNativeIO.socketRead(SocketNativeIO.java:32)
at
java/net/SocketInputStream.socketRead0(Ljava/io/FileDescriptor;[BIII)I(Socket
InputStream.java)
at java/net/SocketInputStream.read(SocketInputStream.java:129)
at oracle/net/ns/Packet.receive(Packet.java:293)
at oracle/net/ns/DataPacket.receive(DataPacket.java:104)
at oracle/net/ns/NetInputStream.getNextPacket(NetInputStream.java:315)
at oracle/net/ns/NetInputStream.read(NetInputStream.java:260)
at oracle/net/ns/NetInputStream.read(NetInputStream.java:185)
at oracle/net/ns/NetInputStream.read(NetInputStream.java:102)
at
oracle/jdbc/driver/T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputS
treamWrapper.java:124)[inlined]
at
oracle/jdbc/driver/T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapp
er.java:80)[optimized]
at
oracle/jdbc/driver/T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1136)[inlined]
Snippet 6: Sample thread waiting for DB Call to finish
The issue might be due to the database is receiving multiple SQL statements and SQL
statements are queued for processing. SQL statements are executed in the database quickly but
every client is using the shared connection, a SQL statement gets executed only when it gets
resources. In this scenario, AWR report will not be true depiction of actual timings. AWR report
depicts the actual query execution time not the waiting time due to shared connection.
If AWR report depicts that SQL statement execution is sufficiently fast but WLS threads are
waiting for database calls to finish, try dedicated mode.
Dedicated mode setting can be done on server as well as client side.
For client side, add the property ServerType=dedicated in the connection pool
For server side take help DBA
39
Database server should be ready to accept dedicated connection only then ServerType =
dedicated makes sense.
Any changes to datasources properties require server restart.
5 Reference
1. WebLogic Server Performance And Tuning:
http://docs.oracle.com/cd/E13222_01/wls/docs100/perform/index.html
2. Oracle Fusion Middleware Performance and Tuning for Oracle WebLogic Server:
http://docs.oracle.com/cd/E28280_01/web.1111/e13814/toc.htm
3. Oracle Fusion Middleware Configuring and Managing JDBC Data Sources for Oracle
WebLogic Server: http://docs.oracle.com/cd/E23943_01/web.1111/e13737/toc.htm
4. Oracle Fusion Middleware Introduction to Oracle WebLogic Server:
http://docs.oracle.com/cd/E23943_01/web.1111/e13752/toc.htm
5. Oracle Database Administrator's Guide:
http://docs.oracle.com/cd/B28359_01/server.111/b28310/toc.htm
40