[master] 15ec79c Concentrate the acceptor-setup-session code.

Poul-Henning Kamp phk at phk.freebsd.dk
Fri Mar 27 09:30:52 CET 2015

In message <CAJV_h0YFE=9Ad6dOwf+z5aq3aFqROtzA8kdSowTOYgRRAMv05g at mail.gmail.com>
, Federico Schwindt writes:

>Attached is a patch in that effect.
>I have no empirical evidence this will improve things but I believe Fastly
>and others are doing it with good results.

As I understand the documentation of SO_REUSEPORT your patch is a no-op.

See for instance:   http://lwn.net/Articles/542629/

SO_REUSEPORT allows you to bind(2) multiple sockets to the same port number[1].

Setting the option but not creating more sockets doesn't do anything.

What we do fall somewhere in the middle between the two scenarios descriped
in the article above:  We have a single acceptor thread per thread pool.

I have no idea how that performs relative to having multiple sockets, but
I'd like to see some actual numbers before we start ripping things up.


[1] You can already do that with UDP under certain circumstances, but it
    is not allowed for TCP.

Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

More information about the varnish-dev mailing list