Welcome! Log In Create A New Profile

Advanced

Re: SO_REUSEPORT

Maxim Dounin
June 10, 2015 08:54AM
Hello!

On Wed, Jun 10, 2015 at 11:46:49AM +0200, basti wrote:

> Hello,
> Ihave rebuild nginx 1.9.1 from source to use SO_REUSEPORT on my wheezy
> install with kernel 3.16 (from backports).
> (packages from http://nginx.org/packages/mainline/debian/has not include
> SO_REUSEPORT)
>
> Some errors are still present:
>
> [emerg] 19351#19351: duplicate listen options for 0.0.0.0:80 in ...
>
> Is there a way to use "reuseports" for multiple locations?
> How can I test if it works for a special location?
> Is there a header send or something else? Or is the only way to compare
> "stress test" like siege?

Much like all other listening socket options, "reuseport" have to
be specified only once, usually in a default server for a listen
socket in question. That is, if you have many servers listening
on port 80, you should write something like:

server {
listen 80 reuseport;
server_name default.example.com;
...
}

server {
listen 80; # no options here
server_name virtual.example.com;
...
}

To check if reuseport actually works just check how many listening
sockets were created - normally there will be just one,
but with reuseport you'll see multiple listening sockets, one for
each of nginx worker processes. Something like "ss -nlt" should
show listening sockets on Linux.

--
Maxim Dounin
http://nginx.org/

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

SO_REUSEPORT

basti June 10, 2015 05:48AM

Re: SO_REUSEPORT

itpp2012 June 10, 2015 06:06AM

RE: SO_REUSEPORT

Lukas Tribus June 10, 2015 06:12AM

Re: SO_REUSEPORT

basti June 10, 2015 06:12AM

Re: SO_REUSEPORT

Maxim Konovalov June 10, 2015 06:40AM

Re: SO_REUSEPORT

basti June 10, 2015 06:54AM

Re: SO_REUSEPORT

Maxim Dounin June 10, 2015 08:48AM

Re: SO_REUSEPORT

itpp2012 June 10, 2015 08:59AM

Re: SO_REUSEPORT

Maxim Dounin June 10, 2015 08:54AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 98
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready