sysguard_load

The `sysguard_load` directive configures system load monitoring thresholds, triggering specified actions when load is exceeded.

Syntaxsysguard_load load=value [action=string];
Defaultnone
Contexthttp, server, location
Arguments1-2

Description

The sysguard_load directive in the NGINX sysguard module allows administrators to set load averages that, if exceeded, will initiate a specified action. It accepts one or two arguments: the first specifies the load threshold, and the optional second argument defines the action to be taken when that threshold is surpassed. This capability is crucial for maintaining server performance, particularly under high traffic conditions. The directive integrates with the sysguard framework, which manages server health in real-time, helping to prevent overload scenarios that can lead to degraded service or downtime.

When configured, if the server load average exceeds the defined threshold, the specified action will be executed—typically a redirect to a maintenance page or a 503 Service Unavailable response to users. Multiple instances of this directive can be employed within the same configuration block, allowing for nuanced control over different server contexts. Importantly, the implementation requires the sysguard module to be compiled into NGINX and correctly initialized, ensuring that the necessary metrics can be monitored effectively.

While setting thresholds, it's also essential to consider system capabilities and typical load patterns to avoid false positives that may mistakenly trigger the action. Additionally, ensuring that proper logging is enabled can assist in troubleshooting any incidents where the load limitations are reached, providing insights into potential traffic spikes or system bottlenecks.

Config Example

sysguard_load load=10.5 action=/loadlimit;

Ensure proper context; sysguard_load must be defined within a valid http, server, or location block.

The action directive must point to a valid location or handler configured within NGINX; otherwise, it will result in a server error.

Avoid setting the load threshold too low, which may result in unnecessary service interruptions during normal traffic fluctuations.

← Back to all directives