W3cubDocs

/Apache HTTP Server

Apache Module mod_ratelimit

Description: Bandwidth Rate Limiting for Clients
Status: Extension
ModuleIdentifier: ratelimit_module
SourceFile: mod_ratelimit.c
Compatibility: rate-initial-burst available in httpd 2.4.24 and later.

Summary

Provides a filter named RATE_LIMIT to limit client bandwidth. The throttling is applied to each HTTP response while it is transferred to the client, and not aggregated at IP/client level. The connection speed to be simulated is specified, in KiB/s, using the environment variable rate-limit.

Optionally, an initial amount of burst data, in KiB, may be configured to be passed at full speed before throttling to the specified rate limit. This value is optional, and is set using the environment variable rate-initial-burst.

Example Configuration

<Location "/downloads">
    SetOutputFilter RATE_LIMIT
    SetEnv rate-limit 400 
    SetEnv rate-initial-burst 512
</Location>
If the value specified for rate-limit causes integer overflow, the rate-limited will be disabled. If the value specified for rate-limit-burst causes integer overflow, the burst will be disabled.

© 2017 The Apache Software Foundation
Licensed under the Apache License, Version 2.0.
https://httpd.apache.org/docs/2.4/en/mod/mod_ratelimit.html