martedì 5 gennaio 2016

How to Create an HEAP Resource Consumption Manager in WLS 12.2.1 and How to Test it on a Domain Partition (Notify, Slow, Shutdown)

You have learned :
Now we will create an HEAP RCM (Resource Consumption Manager) on a Domain Partition and we will test the:
  • SLOW
Remember that to use RCM we have already setted, in this POST, the required parameters:
“-XX:+UnlockCommercialFeatures -XX:+ResourceManagement -XX:+UseG1GC”
You must download the new version (released on 05:01:2016) of:
I have changed, on it, the heap.jsp file that we need for the purpose of this post.
So you need to undeploy the previous one, used in the previous postredeploy and activate the new TestApp.war.
You must have TestApp.war, deployed only on dp1.
We can proceed now with the creation of a new RCM: 
Select WebLogic Domain->Environment->Resource Consumption Managers

Lock & Edit the console:

Click on "Add resource manager":

We will create a RCM with (values on a selected Domain Partition):

  • Notify trigger at 50MB of HEAP Allocation
  • Slow Trigger at 100MB of HEAP Allocation
  • Shutdown Trigger at 150MB of HEAP Allocation

Put the values then click on OK:

This is the new RCM:

Now we must assign that RCM to a specific Domain Partition, in our case we choose dp1:

Select WebLogic Domain->Environment->Domain Partitions

Select dp1:

select Domain Partition->Administration->Resource Sharing:

Click on "Use a resource manager configured for the domain" then choose the new RCM (Heap in our case):

Click on Save:

Activate Changes:

In the following image you can see:

  • a broser to call (on MTCLuster-1 on dp1) the TestApp.war application (http://localhost:7101/dp1/TestApp/heap.html)
  • JMC console to see the Heap Allocation on MTCluster-1
  • a terminal window with a "tail -f" of the log file MTCluster-1.log

In the previous POST I have already explained how to use JMC and where find the MTCluster-1.log.


The Notify Trigger is setted on 50MB, so in http://localhost:7101/dp1/TestApp/heap.html we can put 80 (we need a number >50) and click submit, the application TestApp will allocate 80MB of Heap:

Il the log file (highlighted part) we have received the Notify Trigger:


The Slow Trigger is setted on 100MB, so in http://localhost:7101/dp1/TestApp/heap.html we can put 120 (we need a number >100) and click submit, the application TestApp will allocate 120MB of Heap:

Il the log file (highlighted part) we have received the Slow Trigger:  (obviously we have received also a Notify Trigger)


The Shutdown Trigger is setted on 150MB, so in http://localhost:7101/dp1/TestApp/heap.html we can put 250 (we need a number >150) and click submit, the application TestApp will allocate 250MB of Heap:

(my test application is not the best one to allocate Memory :) so sometime GC is faster then the asyncronous evaluation for the Shutdown Trigger, and maybe that you need to resend the request of allocation of memory [sorry...])

As you can see, in the next image,we have received a FORCE SHUTDOWN:

This shutdown is only for dp1 on MTCluster-1, because we have allocated memory only on this managed server.

Remember that we have:
MTCluster-1 with port 7101 with dp1 and dp2
MTCluster-2 with port 7102 with dp1 and dp2

TestApp.war is deployed only on dp1

If you try to reload the application you will receive a 404 Error, because the dp1 on MTCluster-1 is now down, but in JMC you can see that the JVM on MTCluster-1 is alive and running:

dp1 is still live on MTCluster-2:
try to load http://localhost:7102/dp1/TestApp/heap.html

dp2 is live on MTCluster-1:
try to load http://localhost:7101/dp2/InMemRepClient/Session

If you select the Deployments page you can see that TestApp that is deployed only on dp1 is UP on MTCluster-2 and DOWN on MTCluster-1:

Nessun commento:

Posta un commento