WebLogic Performance and Tuning: Part 1
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.
Join the DZone community and get the full member experience.Join For Free
Sensu is an open source monitoring event pipeline. Try it today.
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:
- Expand Server Folder
- Click on specific Server for which you wish to enable the performance pack.
- Click on Tuning Tab.
- Check Enable Native I/O box.
- 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.
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.
- Native Garbage Collection is the less efficient of the two. It examines every Object in the heap to determine which ones are not referenced.
- Generational Garbage Collection takes into account the life cycle of the object to speed the collection process.
- Click Configure execute Queues.
- 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.
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 ) )
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
Opinions expressed by DZone contributors are their own.