sysguard

The sysguard directive enables the NGINX sysguard module, which protects the server from high system load or memory usage.

Syntaxsysguard on|off;
Defaultoff
Contexthttp, server, location
Argumentsflag

Description

The sysguard directive is crucial for enabling the NGINX sysguard module, which acts as a protective measure against excess load on the system. When this directive is set to 'on', the sysguard monitoring features are activated, allowing the server to respond to high CPU load or memory usage conditions by directing traffic appropriately, such as serving error pages or limiting access. This is particularly useful for managing server health effectively under load-related stress conditions.

The directive can be specified in the http, server, or location contexts, enabling flexible application at different scopes within the NGINX configuration. Its behavior can be further customized using related directives such as sysguard_load, sysguard_mem, and sysguard_rt, which define specific thresholds for system load, memory usage, and response time, respectively. The sysguard module thus contributes to increased resilience by enabling fine-tuned control over how the server responds when its resource limits are approached.

Config Example

http {
    server {
        sysguard on;
        sysguard_mode or;
        ...
    }
}

Ensure that the sysguard module is correctly compiled and included in your NGINX build.

For sysguard to function as intended, make sure to set appropriate load, memory, and response time limits with related directives.

← Back to all directives