Simulating no of VCores In Anypoint Studio
In this tutorial we are going to demonstrate how can we simulate the no of vcores in Anypoint studio.
Most of the time what happens is when we deploy an application in studio and test with smaller payload it run’s successfully in Local, but when deploy the same application on Cloudhub and start doing the load testing it show Out Of Memory (OOM) issues, to catch the errors in the development phase we can simulate the vcores in Anypoint studio and can catch any performance issues much prior to load testing before actual load test on environment
To demonstrate this we are going to create a mule application in Anypoint studio and convert json to CSV and deploy the application on Anypoint studio and Cloudhub and see the OOM issues encountered while sending the request
Create mule application
Deploy application to cloudhub
Trigger the request from postman, here we are sending the large json payload size (more than 80 MB)
See the error below, we can see OOM and JVM issues and then application shutdown automatically
Now we will reproduce the same issue in Anypoint studio
To simulate the issue, we need to configure the below parameters in Anypoint studio
Settings for 0.1 VCore
-Xms480m -Xmx480m -XX:ReservedCodeCacheSize=64m -XX:MaxDirectMemorySize=32m -XX:MaxMetaspaceSize=256m
Go to application->Right Click->Run Configuration-> Go to Arguments->
Click Run, application will deploy successfully on local
While trigger the request from postman application shutdown due to out of memory errors
When we change the setting to 0.2 vcore in local or in Cloudhub and deploy the application with 0.2 vcore, application runs successfully and process the big json payload to CSV without any issues
Settings for 0.2 VCore
-Xms960m -Xmx960m -XX:MaxDirectMemorySize=128m -XX:ReservedCodeCacheSize=240m -XX:MaxMetaspaceSize=256m
Application deployed on local with 0.2 vcore
Trigger the json request from postman, it processed all the records successfully
Great Job on this piece! How to define the values for 0.1Vcore and 0.2Vcore,etc? is the below values(settings) are always static for each Vcore?
How to calculate the values(settings) like below for other Vcores like 1,2,4,8,16Vores?
0.1Vcore
----------
-Xms480m
-Xmx480m
-XX:ReservedCodeCacheSize=64m
-XX:MaxDirectMemorySize=32m
-XX:MaxMetaspaceSize=256m
0.2Vcore
----------
-Xms960m
-Xmx960m
-XX:MaxDirectMemorySize=128m
-XX:ReservedCodeCacheSize=240m
-XX:MaxMetaspaceSize=256m