Maxim Dounin mdounin at
Wed Jun 10 12:53:16 UTC 2015


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 not include
> Some errors are still present:
> [emerg] 19351#19351: duplicate listen options for 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 {
        listen 80; # no options here

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

More information about the nginx mailing list