Configure System Resources for Pulse Agents
You can limit the CPU and memory resources used by Pulse agents by configuring the file.vars.yml
A new section is available in systemd to define CPU and memory limits for each agent.vars.yml
This enables you to:
- Limit CPU and memory usage for Pulse agents
- Prevent Pulse agents from consuming excessive system resources
- Allocate resources consistently across cluster nodes
- Improve overall cluster stability and performance
- Adjust resource limits based on the systemd version on the host
Configure Resource Limits
To manage CPU and memory limits for Pulse agents, update the field in systemd.vars.yml
systemd:
- case:
- range:
From: "0"
To: "231"
pulseaxn:
- service:
CPUShares: "1024"
MemoryLimit: 1G
pulsejmx:
- service:
CPUShares: "1024"
MemoryLimit: 1G
pulselogs:
- service:
CPUShares: "1024"
MemoryLimit: 1G
pulsenode:
- service:
CPUShares: "1024"
MemoryLimit: 3G
pulseyarnmetrics:
- service:
CPUShares: "1024"
MemoryLimit: 1G
- case:
- range:
From: "232"
To: "0"
pulseaxn:
- service:
CPUWeight: "100"
MemoryMax: 1G
pulsejmx:
- service:
CPUWeight: "100"
MemoryMax: 1G
pulselogs:
- service:
CPUWeight: "100"
MemoryMax: 1G
pulsenode:
- service:
CPUWeight: "100"
MemoryMax: 3G
pulseyarnmetrics:
- service:
CPUWeight: "100"
MemoryMax: 1G
The applied keys depend on the systemd version available on the host.
Manage CPU Resources
Pulse supports the following CPU configuration parameters:
- The default value for
is 1024. Valid range: 2–262144CPUShares - The default value for
is 100. Valid range: 1–10000CPUWeight
If no CPU value is provided in , Pulse applies the default value.vars.yml
Lower values allocate fewer CPU resources, while higher values allocate more.
Manage Memory Resources
Pulse supports the following memory configuration parameters:
- Use suffixes
,K,M, orGto specify units:T= KilobytesK= MegabytesM= GigabytesG= TerabytesT
If no value is provided for or MemoryMax, Pulse applies the default value of 1G.MemoryLimit
Info
Assign the same memory value for both and MemoryMax. The Hydra agent automatically applies the appropriate key based on the systemd version.MemoryLimit
Only one systemd range applies per host. Pulse selects the correct range and applies the corresponding values.
For more information, see: systemd resource control documentation.
Increase System Resources
To increase CPU or memory limits, update the values in .override.yml
systemd:
- case:
- range:
From: "0"
To: "231"
pulseaxn:
- service:
CPUShares: "1024"
MemoryLimit: 1G
pulsejmx:
- service:
CPUShares: "1024"
MemoryLimit: 1G
pulselogs:
- service:
CPUShares: "1024"
MemoryLimit: 1G
pulsenode:
- service:
CPUShares: "1024"
MemoryLimit: 3G
pulseyarnmetrics:
- service:
CPUShares: "1024"
MemoryLimit: 1G
- case:
- range:
From: "232"
To: "0"
pulseaxn:
- service:
CPUWeight: "100"
MemoryMax: 1G
pulsejmx:
- service:
CPUWeight: "100"
MemoryMax: 1G
pulselogs:
- service:
CPUWeight: "100"
MemoryMax: 1G
pulsenode:
- service:
CPUWeight: "100"
MemoryMax: 3G
pulseyarnmetrics:
- service:
CPUWeight: "100"
MemoryMax: 1G
Modify the values as needed based on your environment.
Apply the Changes
After updating the configuration, run the following command:
accelo reconfig cluster
Example: Set a Hard CPU Limit Using override.yml
override.yml
If you want to enforce a hard CPU limit (for example, restricting pulsenode to a maximum of 1 CPU core), you can configure this through systemd resource control settings in .override.yml
Add or modify the following section:
systemd:
- case:
- range:
From: "0"
To: "231"
pulseprofiler:
- service:
CPUShares: "1024"
MemoryLimit: 1G
CPUQuota: "100%"
- case:
- range:
From: "232"
To: "0"
pulsenode:
- service:
CPUWeight: "100"
MemoryMax: 1G
CPUQuota: "100%"
Apply the Changes
After updating the file, run the following command:
accelo reconfig cluster
Once the reconfiguration completes, the updated resource limits will be reflected in the systemd service definition.
Example Output in the systemd Service File
cat /etc/systemd/system/pulsenode.service
[Unit]
Description=Acceldata Pulse Node Agent - pulsenode
After=network.target
[Service]
EnvironmentFile=-/etc/default/hydra
EnvironmentFile=-/etc/default/pulsenode
User=adpulse
ExecStart=/bin/sh -c 'exec ${PULSE_HOME}/bin/pulsenode -config ${PULSE_HOME}/node/config/node.conf -config-directory ${PULSE_HOME}/node/config/node.d $TELEGRAF_OPTS'
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
RestartForceExitStatus=SIGPIPE
KillMode=control-group
UMask=0023
CPUQuota=100%
CPUWeight=100
MemoryMax=1G
[Install]
WantedBy=multi-user.target

Have a suggestion?