Sabtu, 25 Februari 2017

Increasing the Java Heap size for a Admin Server & managed server in Weblogic

For better performance, we may need to increase the heap size for each Managed Server in our environment.

As per performance tuning guidelines it is good practice to start Admin server with lower JVM heap size than your other managed servers because the Admin server doesn't required much resources.
By doing this you can utilize the free memory with others where it is needed (This makes sense when you are running Admin and Managed servers on same host)

The size is set in the setDomainEnv.sh file for Linux or setDomainEnv.cmd for Windows, which is in the $DOMAIN_HOME/bin directory.

Steps to set the heap size for Admin and managed server:

1. Shutdown Admin and Managed servers

2. Take backup of setDomainEnv.sh or setDomainEnv.cmd file in case something goes wrong, you can revert the changes. It is best practice to take backup before you made changes in the servers.

3. Open  setDomainEnv file that is under the  $DOMAIN_HOME/bin directory.

4. Copy and paste the below lines in the setDomainEnv file. Make sure you paste the below line at suitable location.

 
#In case of Admin Server

if [ "${SERVER_NAME}" == "AdminServer" ] ; then
USER_MEM_ARGS="-Xms1024m -Xmx1024m -XX:MaxPermSize=512m"
export USER_MEM_ARGS
fi

#In case of osb_server1 Server

if [ "${SERVER_NAME}" == "osb_server1" ] ; then
USER_MEM_ARGS="-Xms512m -Xmx4096m -XX:MaxPermSize=4096m"
export USER_MEM_ARGS
fi


 Xms: The initial heapsize
 Xmx: The max heapsize

5. Start the Admin server and Managed server.

6. Verify the changes via weblogic console or in logs.


Tidak ada komentar:

Posting Komentar