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

Simulating VCores in Anypoint Studio

 

Deploy application to cloudhub

Simulating VCores in Anypoint Studio

 

Trigger the request from postman, here we are sending the large json payload size (more than 80 MB)

Simulating VCores in Anypoint Studio

 

See the error below, we can see OOM and JVM issues and then application shutdown automatically

Simulating VCores in Anypoint Studio

 

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->

Simulating VCores in Anypoint Studio

 

Click Run, application will deploy successfully on local

Simulating VCores in Anypoint Studio

 

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

Graphical user interface, text, application, email Description automatically generated

 

  
Thank you for taking out time to read the above post. Hope you found it useful. In case of any questions, feel free to comment below. Also, if you are keen on knowing about a specific topic, happy to explore your recommendations as well.
 
For any latest updates or posts on our website, you can follow us on LinkedIn. Look forward to connecting with you there.


Share this:
Subscribe
Notify of
guest
1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Kiraan Reddy Yanamala
Kiraan Reddy Yanamala
7 months ago

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