freebsd-dev/share
Andrew Gallatin a034518ac8 Filter TCP connections to SO_REUSEPORT_LB listen sockets by NUMA domain
In order to efficiently serve web traffic on a NUMA
machine, one must avoid as many NUMA domain crossings as
possible. With SO_REUSEPORT_LB, a number of workers can share a
listen socket. However, even if a worker sets affinity to a core
or set of cores on a NUMA domain, it will receive connections
associated with all NUMA domains in the system. This will lead to
cross-domain traffic when the server writes to the socket or
calls sendfile(), and memory is allocated on the server's local
NUMA node, but transmitted on the NUMA node associated with the
TCP connection. Similarly, when the server reads from the socket,
he will likely be reading memory allocated on the NUMA domain
associated with the TCP connection.

This change provides a new socket ioctl, TCP_REUSPORT_LB_NUMA. A
server can now tell the kernel to filter traffic so that only
incoming connections associated with the desired NUMA domain are
given to the server. (Of course, in the case where there are no
servers sharing the listen socket on some domain, then as a
fallback, traffic will be hashed as normal to all servers sharing
the listen socket regardless of domain). This allows a server to
deal only with traffic that is local to its NUMA domain, and
avoids cross-domain traffic in most cases.

This patch, and a corresponding small patch to nginx to use
TCP_REUSPORT_LB_NUMA allows us to serve 190Gb/s of kTLS encrypted
https media content from dual-socket Xeons with only 13% (as
measured by pcm.x) cross domain traffic on the memory controller.

Reviewed by:	jhb, bz (earlier version), bcr (man page)
Tested by: gonzo
Sponsored by:	Netfix
Differential Revision:	https://reviews.freebsd.org/D21636
2020-12-19 22:04:46 +00:00
..
colldef Add collation version support to querylocale(3). 2020-11-08 02:50:34 +00:00
ctypedef Fix CTYPE for ja_JP.eucJP and ja_JP.SJIS. 2020-06-29 03:23:13 +00:00
dict
doc Add the firmware blob required to use the sdma hardware in the imx6 2020-11-26 01:40:04 +00:00
dtrace Add dtrace SDT probe ipfw:::rule-matched. 2020-10-21 15:01:33 +00:00
examples Remove macros from the width arguments passed to Bl macros 2020-11-12 17:28:29 +00:00
i18n
keys pkgbase: Add the pkg trusted keys to the FreeBSD-utilities package 2019-09-05 19:17:17 +00:00
man Filter TCP connections to SO_REUSEPORT_LB listen sockets by NUMA domain 2020-12-19 22:04:46 +00:00
misc Complete steps 5 and 9 from Committer's guide 2020-12-16 16:59:52 +00:00
mk Remove additional GDB leftovers missed in r368667 2020-12-15 18:12:03 +00:00
monetdef Add ga_IE.UTF-8 locale. 2018-11-26 19:39:49 +00:00
msgdef Add ga_IE.UTF-8 locale. 2018-11-26 19:39:49 +00:00
numericdef Add ga_IE.UTF-8 locale. 2018-11-26 19:39:49 +00:00
security
sendmail
skel Make sh(1) support \u in PS1. This removes one fork/exec on interactive 2019-01-24 11:59:46 +00:00
snmp Add entries for the OID used for NFS-over-TLS "user@domain". 2020-09-03 20:42:30 +00:00
syscons Add danish translations provided by GitHub user scootergriesen 2020-09-24 09:06:04 +00:00
tabset
termcap Update the screen termcap entries 2020-05-07 12:43:28 +00:00
tests
timedef Finsh readding Big5 in r317204, which was reverting r315568. This commit 2019-06-20 07:17:16 +00:00
vt vt/fonts: fix typo 2020-12-02 09:42:02 +00:00
zoneinfo Always install backward compatibility timezones, as they are installed 2020-04-09 05:11:18 +00:00
Makefile
Makefile.inc