| Syntax: | limit_conn_zone $variable zone = name : size |
| Default: | |
| Context: | http |
| Reference: | limit_conn_zone |
Sets the parameters for a zone that keeps state for various keys. This state stores the current number of connections in particular. The key is the value of the specified variable. Example usage:
limit_conn_zone $binary_remote_addr zone=addr:10m;
Here, an IP address of the client serves as a key. Note that instead of $remote_addr, the $binary_remote_addr variable is used here. The length of the $remote_addr variable's value can range from 7 to 15 bytes, and the stored state occupies either 32 or 64 bytes of memory on 32-bit platforms, and always 64 bytes on 64-bit platforms. The length of the $binary_remote_addr variable's value is always 4 bytes, and the stored state always occupies 32 bytes on 32-bit platforms, and 64 bytes on 64-bit platforms. One megabyte zone can keep about 32 thousand 32-bit states, and about 16 thousand 64-byte states. If the storage for a zone is exhausted, the server will return error 503 (Service Temporarily Unavailable) to all further requests.