Cloud Edition - Wrapper.java.maxmemory

Hi all,

Is there something funky I have to do to change the maxmemory parameter when using Ignition Cloud Edition? I can change it just fine on a "standard" version of Ignition but no matter what I do on the Amazon EC2 instance the memory seems to be fixed at 50%.

I've also examined the running process and for some reason it does seem to default to 50% but I can't find where it's being set...

This is a result of ps -ef

ignition 27560 1 0 May07 ? 00:23:57 /usr/local/bin/ignition/./ignition-gateway /usr/local/bin/ignition/data/ignition.conf wrapper.syslog.ident=Ignition-Gateway wrapper.pidfile=/usr/local/bin/ignition/./Ignition-Gateway.pid wrapper.daemonize=TRUE wrapper.name=Ignition-Gateway wrapper.displayname=Ignition-Gateway wrapper.statusfile=/usr/local/bin/ignition/./Ignition-Gateway.status wrapper.java.statusfile=/usr/local/bin/ignition/./Ignition-Gateway.java.status wrapper.script.version=3.5.42 wrapper.java.initmemory=0 wrapper.java.maxmemory=0 wrapper.java.initmemory.percent=50 wrapper.java.maxmemory.percent=50

In ignition.conf I have set

Initial Java Heap Size (in MB)

wrapper.java.initmemory=1024

Maximum Java Heap Size (in MB)

wrapper.java.maxmemory=3072

@kcollins1 do you know how this works in Cloud Edition?

There are some extra bits in Ignition Cloud Edition that facilitate driving Ignition memory settings based on a percentage of total system memory. This is done via systemd service configuration, which is what allows it to continue to take effect independently of a restored GWBK or other modifications to data/ignition.conf. The goal being that you can change your instance size to increase memory and have Ignition scale up its usage automatically.

The memory percentages increase as total system memory increases as well--with a 4GiB instance, it is going to use 50%. Once you go past 16GiB, it uses a 85% max heap setting.

You can tune this yourself by creating a systemd override file at /etc/systemd/system/Ignition-Gateway.service.d/01-custom.conf with contents like below (this example sets memory percentage to 60%):

[Service]                                                                                                                                                                           
# Setting ExecStart= to blank like below cancels out base ExecStart definitions in the main service file[s]
ExecStart=
ExecStart=/usr/local/bin/ignition-entrypoint.sh -v -m 60

Once you create this file, don't forget to systemctl daemon-reload before you systemctl restart Ignition-Gateway.service. For more information and a guided walk-through, take a look at this:

asciicast

I'll look into working with our docs team to get something into our Cloud Edition docs for this.

2 Likes

Fantastic - thanks for this info - got it working as we wanted :grinning:

1 Like