Oracle WebLogic Performance & Tuning—Comprehensive Study Notes
Top Tuning Recommendations for WebLogic Server
WebLogic performance tuning is iterative: establish objectives → measure → locate bottlenecks → tune → re-measure. Oracle’s universal quick wins:
- Tune connection/JDBC/EJB/MDB pool sizes so that \text{pool_size}\approx\text{expected concurrent threads}.
- Keep frequently used SQL in the Prepared-Statement cache.
- Prefer the Logging‐Last-Resource (LLR) optimization to XA where only one database participates.
- Raise Connection-Backlog and AcceptCount so HTTP/T3 request bursts aren’t refused.
- Use optimistic or read-only concurrency for CMP entity beans; cache between tx.
- Always call by reference (local interfaces or call-by-reference=true) for intra-application EJB calls.
- Use eager relationship caching for related entity loads.
- Design lean HTTP sessions; set quotas & paging for JMS.
Performance Tuning Roadmap
- Define CPU-, latency-, and throughput targets.
- Instrument JVM/OS/DB/Net; use WLDF + JFR.
- Detect the slowest shared resource; shrink it with tuning not hardware first.
- Apply tuning layers in order:
1️⃣ Code & SQL → 2️⃣ DB config → 3️⃣ WebLogic params → 4️⃣ JVM → 5️⃣ OS. - Iterate until \text{perf_metric}\ge\text{objective}.
JVM Tuning Highlights
- Certified JDK only; HotSpot options are preferred.
- Heap: size it so that GC < of elapsed time. Start with .
- NewGen of heap; SurvivorRatio .
- Verbose GC + JFR to confirm collections.
- Choose GC: G1 for large heaps (multi-GB); Parallel for throughput; CMS/ZGC for pause-sensitive.
- On 64-bit, enable compressed oops:
-XX:+UseCompressedOops. - For servers set
-serverand-Djdk.tls.ephemeralDHKeySize=2048when using SSL.
WLDF & Java Flight Recorder
- Enable JFR in prod JVM startup:
-XX:+UnlockCommercialFeatures -XX:+FlightRecorder. - In WLDF set Diagnostic Volume = Low for min overhead; High only for short-term triage.
- Image Capture automatically embeds JFR data if HotSpot+JFR active.
Core WebLogic-Server Tuning
Startup Java Opts
-Xms2g -Xmx2g -XX:NewSize=512m -XX:+UseG1GC -Dweblogic.threadpool.MinPoolSize=200.
Thread Management
- Prefer Work Managers; specify
max-threads-constraint,min-threads-constraint,fair-share. - Self-tuning pool default max=400; change with
-Dweblogic.threadpool.MaxPoolSize. - Stuck detection: tune
StuckThreadMaxTime&StuckThreadTimerIntervalif false alarms.
Network I/O
- Use NIO muxer (default). Native muxer only if proven faster on given OS.
- Increase file descriptors (
ulimit -n 8192). - Accept backlog > peak TPS bursts.
Clustering
- Enable XA-Affinity and Transaction Affinity to cut inter-server chatter.
- For HTTP session replication pick async-replication plus
SessionFlushThreshold.
Persistent Store Tuning
- Share one store per server for JMS/JTA/SAF for batching benefits.
- Direct-Write-With-Cache gives best safe throughput; point CacheDirectory to local SSD/Flash.
- Tune
BlockSizeto filesystem block (usually ). - For JDBC stores enable I/O multithreading and set BLOB
ThreeStepThreshold. - On NFS ensure NFS v4 or set
file-locking-enabled=falseand use DB TLog instead.
JDBC / Data Source Tuning
- Set
InitialCapacity = MaxCapacityat boot for prod. - Prepared / Callable cache size ≈ (#distinct SQL per pool).
- Pinned-to-Thread=true in high TPS, thread-affinity apps.
- Use Test-On-Reserve only during debugging or with
SecondsToTrustAnIdlePoolConnection.
Database Tuning Nuggets
- Oracle: size SGA (dbcachesize) for >95 % hit rate; set
OPEN_CURSORShigh; checkpoint tuning. - SQL Server: keep tempdb on fast SSD; adjust recovery interval.
- Sybase: configure engines (#CPU-1); bump I/O block size >2 KB.
EJB & MDB Tuning
- Stateful cache
max-beans-in-cache = concurrent users. - Stateless pool
max-beans-in-free-pool = concurrent threads. - MDBs: use Tx batching—set
max-beans-in-free-poollow when batching on; concurrency = threadpool. - Entity beans: turn on query-cache + optimistic concurrency; disable ready-instances.
JMS Performance Cheat-Sheet
- Always set message-count quotas.
- Paging dir on local SSD; adjust
MessageBufferSize. - Tune ConnectionFactory
MessagesMaximum; for batch ACK: \text{MM}=2\times\text{ack_interval}+1. - Distributed queues: disable server-affinity or set LB policy Per-JVM for even spread.
- Enable Unit-of-Order for strict ordering without single-thread.
- For large msg (>50 KB) enable compression (
GZIP_BEST_SPEED) and raiseMaxMessageSize. - Asynchronous JMS 2.0 send with
CompletionListeneroutperforms one-way. - SAF/Bridge: windowSize ≈100 for <1 KB msgs; dedicate thread per bridge.
Web / JSP / Servlet Tips
- Precompile JSPs (
weblogic.appc) and disable page-checks in prod (pageCheckSeconds=-1). - Enable GZIP compression for static + dynamic.
- Cache fragments via
<wl:cache>tag. - Minimize HTTP session size; aggregate mutable attributes; choose async-replication.
Resource Adapters
- Explode nested JARs in RAR to cut class-loader overhead.
- Implement J2CA 1.5 connection‐pool optimizations (lazy-assoc/enlist).
- Use WorkManager, not raw threads.
Web Services
- Use coarse-grained ops; MTOM/FastInfoSet for binary.
- For WS-RM tune SAF window & thread pool; run store cleaner every .
- Use async, buffering, and Last-Logging-Resource for high throughput.
Tuxedo Connector
- Prefer
ON_STARTUP/INCOMING_ONLYconnection policy. - Co-locate WTC with targets; enable link-level failover; avoid ON_DEMAND.
Capacity Planning Thumb-Rules
- Heap sizing: .
- CPU target 70–80 % for latency apps; 90 % for batch.
- Network: each 56 kbps supports ≈8 HTTP users.
- DB box needs (3\text{–}4\times) the CPU of the WL cluster hosting it.
Useful Equations & Memoranda
- GC % time = \frac{\text{GC_pause_total}}{\text{elapsed}}\times100 (goal ≤5 %).
- Capacity per core ≈ \frac{\text{TPS}}{\text{#cores}}; keep < historical benchmark.
- Accept backlog sizing
"Good performance starts with good design; tuning just lets the design shine."