Payara Micro: Here’s How to Boost Speed and Efficiency

Uncategorized

Payara Micro is designed from the ground-up to be nimble for lightweight, fast deployments. As such, it is ideal for microservices and cloud environments. However, there may be instances where you may want to squeeze every bit of performance out of it. In such cases, the minimalist configuration of Payara Micro comes in handy.

Thanks to this, you can cut Payara Micro’s footprint and speed up startup times, improving the efficiency of your app even more. In effect, depending on your application, you may be able to slash the startup time by up to a third! Here’s how.

Why Go Minimalist?

If you’re running Payara Micro in a container or a resource-constrained environment, every megabyte and millisecond counts. Minimalist configurations help you optimize resource usage and get your apps up and running quickly in such tight environments. 

Disabling Clustering and Hazelcast

Two common areas to streamline are clustering and Hazelcast. Clustering is great for load balancing and high availability, but it adds overhead. If you don’t need these features, you can safely disable clustering to reduce memory usage and improve startup time. Hazelcast provides a distributed data grid for caching and session replication. If these features are not useful within your application, you can disable Hazelcast too.

How to Do It

Here’s the command-line option to disable both clustering and Hazelcast:

java -jar payara-micro.jar --noHazelcast

You can also pass these options in a domain.xml file or through the MicroProfile Config API.

As an example, the start time for Payara Micro with Hazelcast is about 4.4 seconds the first time.

Payara Micro 6.2024.5 #badassmicrofish (build 18) ready in 4,432 (ms)

Starting the same instance without Hazelcast using the above command, the startup time drops to about 1.5 seconds.

Payara Micro 6.2024.5 #badassmicrofish (build 18) ready in 1,578 (ms)

Other Optimizations

JVM Options: Experiment with JVM options, such as garbage collection settings and class data sharing, to optimize memory usage.

Wrap-up

Minimalist configurations are a great way to squeeze the most out of Payara Micro, especially in resource-constrained environments. By carefully choosing which features to enable, you can further optimize startup speed and efficiency without sacrificing the core functionality of your application. Download Payara Micro now to get started! Happy Coding!

 

 

Comments (0)

Post a comment

Your email address will not be published. Required fields are marked *

Payara needs the contact information you provide to us to contact you about our products and services. You may unsubscribe from these communications at any time. For information on how to unsubscribe, as well as our privacy practices and commitment to protecting your privacy, please review our Legal & Privacy Policy.

Related Posts

4 minutes
Uncategorized

Leading the Way: Payara Platform Community 7 Beta Now Fully Jakarta EE 11 Certified

We’re excited to announce that Payara Platform Community 7 Beta application server is now fully certified as Jakarta EE 11 […]

Blue background with coral and fish. Left text: 'MONTHLY CATCH'. Right: laptop screen with tech tabs and Payara Community logo. 4 minutes
Community

The Payara Monthly Catch – August 2025

Welcome aboard the August 2025 issue of The Payara Monthly Catch! With summer in full swing, things may have felt […]

What Is a Java Application Server? A Short Guide 6 minutes
Jakarta EE

What Is a Java Application Server? A Short Guide

Enterprise Java applications power global commerce, healthcare, government and countless other industries. These systems must be scalable, secure and […]