Maxim Dounin
May 03, 2010 08:06PM
Hello!

On Mon, May 03, 2010 at 03:37:49PM -0400, Barry Jaspan wrote:

[...]

> ab -n 4 -c 4 'http://test3.bjaspan.acquia-sites.com/sleep.php?sleep=30'
>
> what I would expect to see is that 3 connections would succeed and the
> fourth would fail quickly with a 503. Instead, what happens is that
> all 4 fail immediately with a 503.
>
> The log is not particularly illuminating (at least to me):
>
> root@bal-11:~# tail -f /var/log/nginx/error.log | grep "limit"
> 2010/05/03 19:29:34 [debug] 4080#0: *1 limit zone: 265A3FCB 1
> 2010/05/03 19:29:34 [debug] 4080#0: *2 limit zone: 265A3FCB 2
> 2010/05/03 19:29:34 [debug] 4080#0: *4 limit zone: 265A3FCB 3
> 2010/05/03 19:29:34 [error] 4080#0: *6 limiting connections by zone
> "max_conn", client: 127.0.0.1, server: domain.name, request: "GET
> /sleep.php?sleep=15 HTTP/1.0", host: "domain.name"
> 2010/05/03 19:29:34 [debug] 4080#0: *6 http write filter limit 0
> 2010/05/03 19:29:34 [error] 4080#0: *8 limiting connections by zone
> "max_conn", client: 127.0.0.1, server: domain.name, request: "GET
> /sleep.php?sleep=15 HTTP/1.0", host: "domain.name"
> 2010/05/03 19:29:34 [debug] 4080#0: *8 http write filter limit 0
> 2010/05/03 19:29:35 [error] 4080#0: *9 limiting connections by zone
> "max_conn", client: 127.0.0.1, server: domain.name, request: "GET
> /sleep.php?sleep=15 HTTP/1.0", host: "domain.name"
> 2010/05/03 19:29:35 [debug] 4080#0: *9 http write filter limit 0
> 2010/05/03 19:29:35 [error] 4080#0: *10 limiting connections by zone
> "max_conn", client: 127.0.0.1, server: domain.name, request: "GET
> /sleep.php?sleep=15 HTTP/1.0", host: "domain.name"
> 2010/05/03 19:29:35 [debug] 4080#0: *10 http write filter limit 0
> 2010/05/03 19:29:35 [debug] 4080#0: limit zone cleanup: 265A3FCB 3
> 2010/05/03 19:29:35 [debug] 4080#0: limit zone cleanup: 265A3FCB 2
> 2010/05/03 19:29:35 [debug] 4080#0: limit zone cleanup: 265A3FCB 1

You had at least 7 connections (*1, *2, *4, *6, *8, *9, *10)
during the test. First 3 were passed through, others were
rejected.

Most likely you configured nginx to proxy to itself and this
causes extra connections.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Race condition in limit_zone/limit_conn?

Barry Jaspan May 03, 2010 03:42PM

Re: Race condition in limit_zone/limit_conn?

Maxim Dounin May 03, 2010 08:06PM

Re: Race condition in limit_zone/limit_conn?

Barry Jaspan May 04, 2010 12:14PM

Re: Race condition in limit_zone/limit_conn?

Maxim Dounin May 04, 2010 01:32PM

Re: Race condition in limit_zone/limit_conn?

Barry Jaspan May 04, 2010 03:14PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 106
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready