- Performance Tuning
In this guide you fill find basic advice for performance tuning of your Helidon application. Most of them target Netty tuning, as Helidon is based on it. You should also consider configuring/tuning Java heap size as per any Java application.
Use io.helidon.microprofile.bundles:helidon-microprofile-core
Use helidon-microprofile-core dependency (and not the helidon-microprofile dependency) and add only what you use. For example:
<dependency>
<groupId>io.helidon.microprofile.bundles</groupId>
<artifactId>helidon-microprofile-core</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.microprofile.metrics</groupId>
<artifactId>helidon-microprofile-metrics</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.microprofile.health</groupId>
<artifactId>helidon-microprofile-health</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.media</groupId>
<artifactId>helidon-media-jsonp</artifactId>
</dependency>Configure Netty worker thread pool size
The Netty worker thread-pool is what handles your incoming requests. It defaults to 2*NCPU. To set it to something else you can set this property in microprofile-config.properties:
server.worker-count=4Configure Helidon server pool size
The Helidon server thread-pool takes requests from Netty and invokes your JAX-RS endpoints. You can control lts configuration in microprofile-config.properties. This is Helidon MP specific only.
server.executor-service.core-pool-size: 2
server.executor-service.max-pool-size: 4To verify settings increase the log level for Helidon’s executor service by adding this to your logging.properties:
io.helidon.common.configurable.ThreadPool.level=FINEConfigure Netty’s maxOrder (Helidon 2.4.1 or earlier)
In some situations Netty can aggressively allocate memory per request. This has been addressed in recent versions of Helidon and Netty, but if you are running an earlier version set this system property when you start your Helidon application:
-Dio.netty.allocator.maxOrder=6You can try smaller numbers.