You have learned :
- WebLogic 12.2.1 & Multitenancy : example of what you can do with some new features
- How to create an Oracle Enterprise Linux 7.2 VM on VirtualBox
- How to install JDK8, WLS12.2.1 & OTD 12.2.1 on Oracle Linux
- Creation of an OTD 12.2.1 Domain & Configuration of an OTD Instance
- How to create a WLS 12.2.1 Domain with Dynamic Cluster, OTD Runtime and Domain Partitions
- How to build the examples provided with WLS 12.2.1
- How to deploy Apps on WLS 12.2.1 Domain Partitions & Demonstration of Isolation of Domain Partitions
In this post we will:
- download & install JMeter
- create a RCM
- assign a RCM to a Domain Partition (Resource Sharing)
- use Java Mission Control to monitor Cpu & Heap
- test the RCM with JMeter
To use RCM we have already setted, in this POST, the required parameters:
“-XX:+UnlockCommercialFeatures -XX:+ResourceManagement -XX:+UseG1GC”
Download JMeter from HERE:
You can download it directly from your browser inside the Oracle Linux VM (if you are connected on Internet), or if you have already it you can use the Shared Dir as discribed in my previuos post:
In the next image you can see how to connect your Oracle Linux VM to the LAN and from where download JMeter:
If you have downloaded JMeter from the VM, you can find the file into the Downloads directory.
Create a directory named TestMaterial under /home/weblogic/Oracle
Move the JMeter file from /home/weblogic/Downloads dir into /home/weblogic/Oracle/TestMaterial dir:
Extrat JMeter into TestMaterial Dir:
Download the following two files that I have prepared for the RCM Test:
Put these files into TestMaterial directory:
Deploy and Activate TestApp.war on Domain Parition dp1.
In THIS post I have explained how to deploy an App on a Domain Partition.
Now we can proceed with the creation of a Resource Consumption Manager (RCM)
Select WebLogic Domain->Environment->Resource Consumption Managers:
Lock & Edit:
Click on Add resource Manager:
We will test in this post the consumption of the CPU (later we will test, also, the Heap Memory):
I would like to obtain a Notify trigger if the average, in a time interval, of the consumprtion of the CPU in a domain partition is around the 10%:
Now we must assign this RCM to a specific Domain Partition:
Select Domain Partition dp1:
Now you can select Domain Partition->Administration->Resource Sharing:
Select "Use a resource manager configured for the domain" and select your RCM, then click on Save:
We are ready to test our CPU RCM on Domain Partition dp1, but to do this we need to:
- monitor cpu utilization in Domain Partition 1 on a Managed Server
- verify in the Log file if appear the Notify string
- use JMeter to generate traffic calling TestApp.
Inside TestApp there is a cpu.jsp that each time is invoked, it calculate the first 42 number of Fibonacci and consume a lot of cpu.
To monitor the CPU utilization on a specific Managed Server we can use Java Mission Control.
You can found JMC under the bin directory of your JDK:
Close the Welcome Page:
We want to test the CPU RCM on dp1 on MTCluster-1, so we must found the correct JVM, to do this select a jvm and click on Start JMX Console:
Click on System tab:
Insert weblogic.Name in the Filter Column, if you find MTCluste-1, you have choose the correct JVM :) (if not ... try with other jvm)
Now is time to start JMeter:
We want to load TestWlsRCMCpu.jmx file inside JMeter, so click on File->Open:
Select your TestWlsRCMCpu.jmx then click on Open:
This file is already configured for our Demo, will start 10 Threads in 30 seconds (1 thread each 3 seconds) so for around 30 seconds we will have cpu consumption.
We need to consume, in a single domain partition, an averageof the 10% of cpu to enable the Notify Trigger.
Remember: as described in RCM Oracle Documentation:
Measurements of Retained Heap and CPU Utilization are performed asynchronously and hence do not represent "current" (a "point-in-time") value.
We will point JMeter to only a Managed Server on dp1, MTCluster-1 (localhost:7101) so we will receive the Notify trigger only in his MTCluster-1.log file:
We will call the cpu.jsp file inside TestApp.war on dp1 on MTCluster-1:
Now we need to monitor the log file to verify that we receive the Notify trigger, so open MTCluster-1.log with the command tail -f MTCluster-1.log:
In the next image you can see:
- JMeter with TestWlsRCMCpu.jmx file loaded
- JMC with JMX console opened on MTCuster-1 JVM
- a Terminal with the "tail -f" of the MTCluster-1.log
If you click on the start icon of JMeter, you will start the Test:
As you can see during the test the CPU is around the 80%:
The test will finish in around 30 seconds and,remember that RCM is asynchronous, if you wait (around other 30 seconds) you will receive the Notify Trigger in the MTCluster-1.log.