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

  1. Define CPU-, latency-, and throughput targets.
  2. Instrument JVM/OS/DB/Net; use WLDF + JFR.
  3. Detect the slowest shared resource; shrink it with tuning not hardware first.
  4. Apply tuning layers in order:
    1️⃣ Code & SQL → 2️⃣ DB config → 3️⃣ WebLogic params → 4️⃣ JVM → 5️⃣ OS.
  5. Iterate until \text{perf_metric}\ge\text{objective}.

JVM Tuning Highlights

  • Certified JDK only; HotSpot options are preferred.
  • Heap: size it so that GC < 5%5\% of elapsed time. Start with Xms=XmxXms=Xmx.
  • NewGen 0.25\approx 0.25 of heap; SurvivorRatio =8=8.
  • 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 -server and -Djdk.tls.ephemeralDHKeySize=2048 when 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 & StuckThreadTimerInterval if 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 BlockSize to filesystem block (usually 4096B4096\,B).
  • For JDBC stores enable I/O multithreading and set BLOB ThreeStepThreshold.
  • On NFS ensure NFS v4 or set file-locking-enabled=false and use DB TLog instead.

JDBC / Data Source Tuning

  • Set InitialCapacity = MaxCapacity at 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_CURSORS high; 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-pool low when batching on; concurrency = threadpool.
  • Entity beans: turn on query-cache + optimistic concurrency; disable ready-instances.

JMS Performance Cheat-Sheet

  1. Always set message-count quotas.
  2. Paging dir on local SSD; adjust MessageBufferSize.
  3. Tune ConnectionFactory MessagesMaximum; for batch ACK: \text{MM}=2\times\text{ack_interval}+1.
  4. Distributed queues: disable server-affinity or set LB policy Per-JVM for even spread.
  5. Enable Unit-of-Order for strict ordering without single-thread.
  6. For large msg (>50 KB) enable compression (GZIP_BEST_SPEED) and raise MaxMessageSize.
  7. Asynchronous JMS 2.0 send with CompletionListener outperforms one-way.
  8. 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 60000ms60000\,ms.
  • Use async, buffering, and Last-Logging-Resource for high throughput.

Tuxedo Connector

  • Prefer ON_STARTUP/INCOMING_ONLY connection policy.
  • Co-locate WTC with targets; enable link-level failover; avoid ON_DEMAND.

Capacity Planning Thumb-Rules

  • Heap sizing: 512bytes×pending queue msgs+256bytes×topic subs\small 512\,\text{bytes}\times\text{pending queue msgs} + 256\,\text{bytes}\times\text{topic subs}.
  • 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 >peak new sockets per second×RTT.>\text{peak new sockets per second}\times \text{RTT}.

"Good performance starts with good design; tuning just lets the design shine."