Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

WebLogic Performance and Tuning: Part 1

DZone's Guide to

WebLogic Performance and Tuning: Part 1

The Java Virtual machine, or JVM, on which WebLogic server runs, is the single most important software component of your system. Fortunately, it is not terribly difficult to properly configure your JVM.

Free Resource

Transform incident management with machine learning and analytics to help you maintain optimal performance and availability while keeping pace with the growing demands of digital business with this eBook, brought to you in partnership with BMC.

The Java Virtual machine, or JVM, on which WebLogic server runs, is the single most important software component of your system. Because all aspects of your application rely on the JVM, it is the single easiest place to ruin the performance of your server.

Fortunately, it is not terribly difficult to properly configure your JVM.

There are several primary areas of improvement:

  • Server performance packs.
  • Heap Configuration.
  • Garbage Collection
  • Weblogic Settings for best performance.

Server Performance Packs

  • Depends on the platform that your WebLogic Server is running on, a performance pack may be available for your system.

  • The value of performance pack is that input/output operations are configured to better utilize the resources of your server more efficiently.
  • To Enable performance packs and thereby utilize the resource of your server more efficiently:
    1. Expand Server Folder
    2. Click on specific Server for which you wish to enable the performance pack.
    3. Click on Tuning Tab.
    4. Check Enable Native I/O box.
  • As I said, performance packs are not available for all server platforms. If you are not running WebLogic on one of the lucky few, WebLogic will allocate Additional threads for use as socket readers, thereby offsetting the performance drain somewhat.

Heap Configuration

  • When it is invoked, the JVM is allocated a certain amount of memory that it organizes into a data structure called heap. This data structure is used by the JVM to store and access all objects utilized by running processes.
  • There are four command-line variables you can set to affect the life cycle of the heap and thereby tune performance. Set the values within the script you use to start WebLogic. Values Should be multiples of 1024 and may be specified in increments of k , m, and g.
    • -Xms The minimum size of the heap. Values should be multiple of 1024 and may be specified in increments of k, m, and g.
    • -Xmx The maximum size of the heap. Values should be multiples of 1024 and may be specified in increments of K , m, and g.
    • -XX:NewSize BEA recommends that the base value of this variable be 25% of the maximum size of the heap. It is increased in increments of 1024. The value Should be increased above the base if you have a large number of short-lived objects or if you have more than one processor.
    • -XX:MaxNewSize Sets the maximum new-generation heap size.
    • -XX:SurvivorRatio The ratio between the eden and survivor space areas in the new heap.
  • Generally your JVM should take up about 75% of the available RAM on your system, after the needs of the operating system are met. Beyond that, the ideal size of your heap is determined to a large extent by the garbage collection process on your system.

Garbage Collection

When an object is no longer accessible from any pointer in the running program, it is considered to be garbage. In order to keep garbage objects from gradually devouring all of the available memory, Java will systematically comb through the heap and de-allocate space associated with garbage objects. This process is known as garbage collection.

  • There are two types of garbage collection, "Generational" and native.
    1. Native Garbage Collection is the less efficient of the two. It examines every Object in the heap to determine which ones are not referenced.
    2. Generational Garbage Collection takes into account the life cycle of the object to speed the collection process.
  • In order to get the best performance out of your server, you'll need to examine Garbage Collection process for each distinct configuration.
    1. Click Configure execute Queues.
    2. Enter name, Queue length, thread priority, and Thread Count.

WebLogic Settings for Best Performance

  • Go to <MW_HOME>\Oracle_Home\user_projects\domains\your_domain\bin, and open setDomainEnv.cmd.
  • Mention heap and perm memory sizes. Find the area in the setDomainEnv.cmd file and change arguments to like below.

Heap Configuration

set WLS_HOME=%WL_HOME%\server
set WLS_MEM_ARGS_64BIT=-Xms1024m -Xmx1024m
set WLS_MEM_ARGS_32BIT=-Xms1024m -Xmx1024m
if NOT "%JAVA_VENDOR%"=="HP" (
    if "%VM_TYPE%"=="HotSpot" (
        set WLS_MEM_ARGS_64BIT=-Xms1024m -Xmx1024m
        set WLS_MEM_ARGS_32BIT=-Xms1024m -Xmx1024m
    )
) 

Perm Size

set MEM_PERM_SIZE_64BIT=-XX:PermSize=128m 
set MEM_PERM_SIZE_32BIT=-XX:PermSize=128m 
if "%JAVA_USE_64BIT%"=="true" ( 
    set MEM_PERM_SIZE=%MEM_PERM_SIZE_64BIT% 
) else ( 
    set MEM_PERM_SIZE=%MEM_PERM_SIZE_32BIT% 
) 
set MEM_MAX_PERM_SIZE_64BIT=-XX:MaxPermSize=256m 
set MEM_MAX_PERM_SIZE_32BIT=-XX:MaxPermSize=256m

Evolve your approach to Application Performance Monitoring by adopting five best practices that are outlined and explored in this e-book, brought to you in partnership with BMC.

Topics:
weblogic 12c ,jvm performance tuning

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}