Sepherosa Ziehau
July 26, 2013 04:10AM
Hi all,

I have the following preliminary patch to enable SO_REUSEPORT feature
on listen sockets:
http://leaf.dragonflybsd.org/~sephe/ngx_soreuseport.diff

The basic idea of the above patch is:
- Defer the listen socket creation until work processes are forked
- Work process creates listen socket, and set SO_REUSEPORT before bind(2)
- Accept mutex is no longer needed, since worker process is not
contended on the single listen socket anymore


The SO_REUSEPORT sockopt on Linux:
https://lwn.net/Articles/542629/

The SO_REUSEPORT sockopt on DragonFlyBSD:
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/740d1d9f7b7bf9c9c021abb8197718d7a2d441c9

The non-blocking accept(2) w/ SO_REUSEPORT performance improvement on
DragonFlyBSD:
http://lists.dragonflybsd.org/pipermail/users/2013-July/053632.html


The preliminary httperf test shows w/ "so_reuseport on" gives me ~33%
req/s performance improvement on DragonFlyBSD:

httperf is running as:
httperf --server=$server_name --wsess=5000,1,1 --max-conn=4

Same testing machines and network configuration as in:
http://lists.dragonflybsd.org/pipermail/users/2013-July/053632.html

Each client runs 16 above httperf test, except the box w/ bce, which
runs 8 above httperf.

The nginx w/ "so_reuseport on" is doing 49852 reqs/s (4 run avg) and
there are 35%~40% idle time on each hyperthread.
The nginx w/o "so_reuseport on" is doing 37386 reqs/s (4 run avg).


Any feedbacks are welcome.

Best Regards,
sephe

--
Tomorrow Will Never Die

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

[PATCH] SO_REUSEPORT support for listen sockets

Sepherosa Ziehau 5320 July 26, 2013 04:10AM

Re: [PATCH] SO_REUSEPORT support for listen sockets

Tom van der Woerdt 1113 July 26, 2013 04:32AM

Re: [PATCH] SO_REUSEPORT support for listen sockets

Piotr Sikora 915 July 26, 2013 07:02AM

Re: [PATCH] SO_REUSEPORT support for listen sockets

Maxim Dounin 1154 July 26, 2013 07:26AM

Re: [PATCH] SO_REUSEPORT support for listen sockets

Sepherosa Ziehau 1029 July 28, 2013 09:24AM

Re: [PATCH] SO_REUSEPORT support for listen sockets

Sepherosa Ziehau 1012 July 29, 2013 05:54AM

Re: [PATCH] SO_REUSEPORT support for listen sockets

Sepherosa Ziehau 867 July 28, 2013 09:12AM

Re: [PATCH] SO_REUSEPORT support for listen sockets

Maxim Dounin 1004 July 29, 2013 10:58AM

Re: [PATCH] SO_REUSEPORT support for listen sockets

Sepherosa Ziehau 1396 July 30, 2013 04:24AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 272
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready