limit_conn_zone

Syntax: limit_conn_zone key zone=name:size;
Default:
Context: stream

Sets parameters for a shared memory zone that will keep states for various keys. In particular, the state includes the current number of connections. The key can contain text, variables, and their combinations (1.11.2). Connections with an empty key value are not accounted. Usage example:

limit_conn_zone $binary_remote_addr zone=addr:10m;

Here, the key is a client IP address set by the $binary_remote_addr variable. The size of $binary_remote_addr is 4 bytes for IPv4 addresses or 16 bytes for IPv6 addresses. The stored state always occupies 32 or 64 bytes on 32-bit platforms and 64 bytes on 64-bit platforms. One megabyte zone can keep about 32 thousand 32-byte states or about 16 thousand 64-byte states. If the zone storage is exhausted, the server will close the connection.

doc_nginx
2017-02-09 07:06:45
Comments
Leave a Comment

Please login to continue.