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

Payara

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

payara qube logo 5 minutes
Payara

Payara Cloud Is Now part of Payara Qube family of Unified Platforms for Enterprise Java

Payara Cloud is becoming part of Payara Qube family of Java application deployment runtimes. This move reflects how the […]

Payara promotional graphic showing transition from Spring to Jakarta EE, including technology logos, a code icon and arrows leading from Spring to Jakarta EE. 6 minutes
Jakarta EE

From Spring Boot To Jakarta EE 11: How Payara Starter Eases The Transition

If you’ve been living in the Spring ecosystem, you’re used to fast project setup. Spring Initializr gives you a […]

Promotional graphic for a podcast episode titled “Why Open Source is the Future of Business Innovation - A conversation with Arun Gupta”. The podcast is hosted by Payara Community. The right side features a photo of the speaker, Arun Gupta, labeled as a “VP, Developer Experience at JetBrains”. The design uses dark blue and teal backgrounds with coral and fish illustrations. 2 minutes
Community

Payara Podcast – Why Open Source is the Future of Business Innovation – A Conversation with Arun Gupta

Open source is no longer a developer-only concern — it’s at the heart of how modern businesses innovate, build […]