9
Xavier Cosultants Weblogic Performanc e Tuning

weblogic perfomence tuning

Embed Size (px)

Citation preview

Page 1: weblogic perfomence tuning

Xavier Cosultants

Weblogic Performance Tuning

1.What Parameters to tune

1.1 OS level parameters to tune

Page 2: weblogic perfomence tuning

Xavier CosultantsTypically most error conditions are TCP tuning parameter related and are caused by the operating system’s failure to release old sockets from a close_wait call. Common errors are “connection refused”, “too many open files” on the server-side, and “address in use: connect” on the client-side. In most cases, these errors can be prevented by adjusting the TCP wait_time value and the TCP queue size.

/dev/tcp tcp_time_wait_interval

/dev/tcp tcp_conn_req_max_q

1.2 JVM level parameters to tune

-Xms & -Xmx parameters to the same value

Specify –XX:Permsize & -XX:MaxPermSize parameters

JVM Architecture

-XX:NewSize-XX:MaxNewSize-XX:SurvivorRatio

Total JVM Heap (Xms Xmx) = Young + Tenured(also called Old)Young = Eden + From (SS1) + To (SS2)Many people configure the JVM Object Heap size with the total JVM size. The Heap size does not include permgen space. So,JVM size = Object Heap size ( Xmx) + PermGen size ( -XX:PermGen –XX:MaxPermGen

1.2.1 How to Enable GC log for JVM

SUN JDK

JAVA_OPTIONS="${JAVA_OPTIONS} -XX:+HeapDumpOnOutOfMemoryError -verbose:gc -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -Xloggc:${LOGDIR}/gc.log"

EDEN ( Young Gen) S2 PermGem-XX:PermGen-XX:MaxPermGen

S1

Tenured ( Old Gen)

Page 3: weblogic perfomence tuning

Xavier CosultantsJROCKIT

JAVA_OPTIONS="$JAVA_OPTIONS -DDebugSecurityAtn=true -DDebugSSL=true -Xverbose:memory -Xverboselog:${LOGDIR}/gc.lo

Keep the server in “Production Mode” ( in production mode the parameters of the weblogic servers are configured for highest performance)

1.3 Server level parameters to tune

1.3.1 Workmanagers

Each workmanager will have three parametersa) Request Class

a. ResponseTime Request Classb. FairShare Request Classc. Context Request Class

b) Min. Thread Constraintc) Max Thread Constraintd) Capacity Constraint

Advantages of WM:

Allows each application to have its own workmanager. We can efficiently allocate the worked threads as per the requirements of the application.

For eg. A heavy application will be assigned a work manger with high no. of threads and a light application can be assigned a light workmanager.

1.3.2 Execute queues

Execute Queues were available in the old version of weblogic. ( 8.1)From 9.2 onwards WorkManagers were introduced.

Execute Queues have a pool of threads associated with him, and all the incoming requests to one weblogic JVM will land to default execute queue.

1.3.2 Difference between Work Managers & Execute Queues

Work managers provide you the ability to better control thread utilization (server performance)than execute-queues, primarily due to the many ways that you can specify scheduling guidelinesfor the priority-based thread pool. These scheduling guidelines can be set either as numeric valuesor as the capacity of a server-managed resource, like a JDBC connection pool.

Number of Available Socket Readers

Page 4: weblogic perfomence tuning

Xavier Cosultants

1.3.3 Struck Threads

A stuck thread is a thread that cannot complete its current work or accept new work because of an unfinished work or a deadlock.

WebLogic Server automatically detects when a thread in an execute queue becomes “stuck.”

StruckThreadMaxTime

1.3.4 Tuning Muxer

SocketReaders are nothing but Muxer Threads.

SOCKET READERS – threads these threads use software packages. These ‘software packages” are called Muxers.

So, a socket reader using a software package called “muxer” is called a muxer thread.Muxers are “software

The socket Muxer manages the server’s existing socket connections. It first determines which sockets have incoming requests waiting to be processed. It then reads enough data to determine the protocol and dispatches the socket to an appropriate runtime layer based on the protocol. In the runtime layer, the socket muxer threads determine which execute thread queue to be used and delegates the request accordingly.Backlog bufferingThe Accept Backlog parameter specifies how manyTransmission Control Protocol (TCP) connections can be buffered in a wait queue

JDBC level parameters to tune

Pool size - keep the optimal value for “initial capacity” , max capacity & capacity increment.

TestConnectionsOnReserve – checks the connections before giving to application. It minimizes the possibility of delivering an invalid connection to the application.

JMS level parameters to tunePersistant store

Page 5: weblogic perfomence tuning

Xavier CosultantsMessage size & Queue SizeBridge

How to force garbage collection & threaddump from console

Servers <server-name> monitoring performance.

A thread dump can also be taken using kill -3 <PID>

Theread dump will be stored in console log.

What are the Types of Garbage Collection

(For sun HOT SPOT JVM)

Page 6: weblogic perfomence tuning

Xavier CosultantsGarbage collections are divided into 4 major types based on how the collection is done in Young Generation & Old Generation.

For Each generation either SERIAL Or PARALLEL algorithms are used.

Both these Serial & Parallel algorithms are STOP-THE-WORLD algorithms. Which means the application will come to stand still ( or stops ) when the GC is happening.

So what is the difference ?

SERIAL – stop-the-world & Uses single ThreadPARALLE – stop-the-world BUT uses Multiple Threads.

Even though PARALLEL GC stops the application, but because it is using multiple threads ( enabled in multi cpu hardware) the GC time is less than a serial collector.

For this reason, PARALLEL GC is also called, through-put GC.

Apart from stop-the-world gc there is another GC , that doesn’t stop the application completely but does it in small pauses. Its called Concurrent Mark Sweep GC.

TYPE OF GC Young Generation

Old Generation

Remarks

SerialGC (-XX:+UseSerialGC) Serial SerialParallGC (-XX:+UseParallelGC) Parallel Serial

Types of GC flow chart

STOP-THE-WORLD GC

SERIAL GC-XX:+UseSerialGC

PARALLEL GC-XX:+UseParallelGC

Concurrent Mark Sweep GC (CMS)

:+UseConcurrentMarkSweep

GC

PARALLEL COMPACTING GC

-XX:+UseParallelOldGC

Page 7: weblogic perfomence tuning

Xavier CosultantsParallel Compacting(-XX:+UseParallelOldGC)

Parallel Parallel

Concurrent Mark Sweep GC(-XX:+UseConcMarkSweepGC)

Parallel CMS So from above table, +UseParallelOldGC & CMS can not be used together.

+XX:-UseParallelNewGC can be used with –XX:+UseConcMarkSweepGC

Sample Output of GC:

What to Look for in GC logs..

Occurrences of garbage collections that were initiated by CICS when the heap utilization threshold was reached.

Occurrences of garbage collections that were caused by an allocation failure.

The amount of free space in the storage heap, in bytes and as a percentage. For Version 1.4.2, the output shows only the amount of free space after a garbage collection, but with Version 5, the amount of free space before a garbage collection is also shown.

The time taken for each garbage collection, in milliseconds.

Occurrences of heap expansion.

The amount by which a storage heap was expanded and the new size of the heap, in bytes.