Skip to main content

Resource Tuning

The Ignition Helm Chart sets pod resource requests and limits by default. This helps the Kubernetes scheduler make the right decisions on where you schedule Ignition to run.

Default settings:

  • 1 CPU core, 1.5Gi of RAM
  • 75% JVM Heap Percentage

Careful attention should be paid to allocation of memory for your Ignition Gateway. The memory requirements can vary widely based on what type of Ignition application you've created and what modules are in use. It can also vary based on more than just JVM heap usage. Direct memory buffers, OS threads, and other native memory usage can all contribute to the overall memory footprint. Some applications can even run fine under normal conditions and then experience spikes in memory usage during certain operations. When memory usage exceeds the container limit, the pod will be terminated by the kubelet and restarted. This is often referred to as an "OOM Kill".

We recommend starting with conservative defaults and observing and tuning during development of your application.

tip

Take a look at Installation → Resources if you haven't yet!

Configuring resource allocations​

The example values below show how to customize resource allocations:

# testing.yaml
gateway:
resourcesEnabled: true
resources:
limits:
cpu: "4"
memory: "4Gi"
requests:
cpu: "4"
memory: "4Gi"
maxRAMPercentage: 50

This configuration will allocate 4 CPU cores and 4Gi of RAM to the Ignition Pod. The JVM will be configured to use 50% (2Gi) of the available RAM for its heap.

Manual Control over Ignition Memory Settings​

If you wish to set only the max heap to a static value (MiB), you can disable the percentage allocation and use Ignition runtime arguments via gateway.runtimeArgs.

gateway:
maxRAMPercentage: 0
runtimeArgs: ["-m", "2048"]

If you want more direct control Ignition memory settings, you can use gateway.wrapperArgs and gateway.jvmArgs directly.

gateway:
maxRAMPercentage: 0
wrapperArgs:
# Set these wrapper args to 0 to allow full control via JVM args
wrapper.java.initmemory: 0
wrapper.java.maxmemory: 0
jvmArgs:
## Manual Percentage Configuration
# - -XX:InitialRAMPercentage=75
# - -XX:MaxRAMPercentage=75
## Explicit Memory Configuration
- -XX:InitialHeapSize=4g
- -XX:MaxHeapSize=4g
## Garbage Collection Customizations
- -XX:+UseG1GC
- -XX:MaxGCPauseMillis=100
warning

Samely-named arguments in gateway.jvmArgs are not deduplicated--they'll be supplied in-order in when Ignition is launched. In most cases the latest argument will take precedence, but there may be certain situations where the duplicates may cause issues at startup.

Useful References: