11.4 Handle a spike in traffic for Helidon apps

When there is an increase in the load of threads that a Helidon application processes, increase the server thread pool size so that the Helidon application can handle the traffic.

Cause

When you run Helidon applications with multiple replicas and a heavy load of multiple threads, ensure that the pool size is adequate to handle the traffic. If there is a spike in traffic while the pool size is small, then requests will either get queued or dropped.

Action

To resolve this issue, specify values for the following properties. These properties are specific to Helidon applications and are not a part of MicroTx Distributed Transactions library properties.

  • core-pool-size: specifies the minimum number of threads that are always kept alive.
  • max-pool-size: specifies the maximum number of threads that can be created to handle the load.

You can set these property values either in the Helm charts or in the application.properties file, which is specific to each application.

Sample entry in Helm Chart

The following example specifies property values under the environment variable section for a Helidon application.

env:
  - name: SERVER_EXECUTOR_SERVICE_CORE_POOL_SIZE
    value: "200"
  - name: SERVER_EXECUTOR_SERVICE_CORE_POOL_SIZE
    value: "500"

Sample entry in the application.properties file

The following example specifies property values for a Helidon application in the tmm.properties file.

server.executor-service.core-pool-size: 200
server.executor-service.max-pool-size: 500