accounting_perturb

The `accounting_perturb` directive enables or disables perturbation in traffic accounting logic for NGINX.

Syntaxaccounting_perturb on | off;
Defaultoff
Contextstream
Arguments1

Description

The accounting_perturb directive is designed to introduce randomness in the accounting process by modifying how requests are recorded. When enabled, it alters the accounting behavior, preventing overly regular patterns in traffic metrics, which can enhance analysis quality over time. This is particularly useful in scenarios where consistent request patterns could mislead traffic analysis and reporting, as it adds variability to how accounting data is aggregated.

Specifically, this directive takes one argument, which is expected to be a boolean value (either 'on' or 'off'). Setting accounting_perturb to 'on' increases randomness in the sample of requests that are processed for accounting, while setting it to 'off' disables this feature, thereby exhibiting traditional consistent sampling. The integration of this feature reflects an understanding of common data patterns in web traffic, allowing administrators to better capture and respond to variations in real-time traffic metrics without being misled by potentially skewed data due to repetitive patterns.

Config Example

http {
    accounting on;
    accounting_log logs/http-accounting.log;
    accounting_perturb on;
    ...
    server {
        server_name example.com;
        accounting_id $http_host;
        ...
    }
}

Ensure that the accounting feature is enabled for accounting_perturb to have an effect.

Misconfiguring this directive could lead to misleading account metrics, especially in high-traffic scenarios.

← Back to all directives