- Lab
- A Cloud Guru
JVM Tuning for JBoss EAP
JBoss Enterprise Application Platform leverages a Java Virtual Machine to run its standalone server and host its applications. As we deploy our applications and leverage JBoss, we want to ensure our apps have optimal performance, and a portion of that lies in optimizing the JVM itself. In this hands-on lab, we explore a number of Java options we can set to ensure our JVM it running the best it can.
Path Info
Table of Contents
-
Challenge
Check for Existing JVM Settings
See if there are any existing Java settings to consider:
echo $JAVA_OPTS
We can now set our options by using
export
on the CLI, or via the console. Let's switch to the console by going toPUBLICIP:9990
and logging in as theadmin
user with the passwordpinehead
. -
Challenge
Set a Fixed Heap Size
-
Navigate to the Configuration section of the HAL Management Console, then select System Properties.
-
Click Add on the right-hand side of the table.
-
Set the Name filed to
JAVA_OPTS
and the Value field to-Xms1024M -Xmx1024M
. -
Click Add
-
-
Challenge
Enable the G1 Garbage Collector and Aggressive Optimizations
The additional options we need also need to be set under the
JAVA_OPTS
variable. SelectJAVA_OPTS
from the table and click Edit. Enable both the garbage collection and aggressive optimizations. The full expression should be:-Xms1024M -Xmx1024M -XX:+UseG1GC -XX:+AggressiveOpts
Select Save.
-
Challenge
Confirm the Changes
- Back on the CLI, open the standalone configuration file and search for
JAVA_OPTS
to confirm the changes:
vim /opt/jboss-eap/standalone/configuration/standalone.xml
Exit the CLI with
exit
.- Restart the server:
sudo systemctl restart jboss-eap-rhel
- Back on the CLI, open the standalone configuration file and search for
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.