A
A
AHTUXPUCT2019-04-29 11:49:47
Nginx
AHTUXPUCT, 2019-04-29 11:49:47

Nginx: limit_conn_zone not working?

There is a simple config for vhost

limit_conn_zone $binary_remote_addr zone=addr:16m;
limit_conn_zone $server_addr zone=server:16m;

server{
        listen 80;
        server_name test.local;

        limit_conn addr 1;
        limit_conn server 5;

        access_log /var/log/nginx/80.access_log main_nosend;
        error_log /var/log/nginx/80.error_log;
        root /www-data;
        location / {
                expires -1;
                index index.html;
        }
}

while this config on version 1.10 shows the following
** SIEGE 4.0.2
** Preparing 5 concurrent users for battle.
The server is now under siege...
HTTP/1.1 503     0.01 secs:     206 bytes ==> GET  /
HTTP/1.1 503     0.01 secs:     206 bytes ==> GET  /
HTTP/1.1 503     0.01 secs:     206 bytes ==> GET  /
HTTP/1.1 503     0.01 secs:     206 bytes ==> GET  /
HTTP/1.1 200     0.01 secs:   78719 bytes ==> GET  /

Transactions:		           1 hits
Availability:		       20.00 %
Elapsed time:		        0.01 secs
Data transferred:	        0.08 MB
Response time:		        0.05 secs
Transaction rate:	      100.00 trans/sec
Throughput:		        7.59 MB/sec
Concurrency:		        5.00
Successful transactions:           1
Failed transactions:	           4
Longest transaction:	        0.01
Shortest transaction:	        0.01

And on older than 1.11 skips everything
** SIEGE 4.0.2
** Preparing 5 concurrent users for battle.
The server is now under siege...
HTTP/1.1 200     0.01 secs:   78719 bytes ==> GET  /
HTTP/1.1 200     0.02 secs:   78719 bytes ==> GET  /
HTTP/1.1 200     0.02 secs:   78719 bytes ==> GET  /
HTTP/1.1 200     0.03 secs:   78719 bytes ==> GET  /
HTTP/1.1 200     0.03 secs:   78719 bytes ==> GET  /

Transactions:		           5 hits
Availability:		      100.00 %
Elapsed time:		        0.03 secs
Data transferred:	        0.38 MB
Response time:		        0.02 secs
Transaction rate:	      166.67 trans/sec
Throughput:		       12.51 MB/sec
Concurrency:		        3.67
Successful transactions:           5
Failed transactions:	           0
Longest transaction:	        0.03
Shortest transaction:	        0.01

what could be the problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question