]> git.ipfire.org Git - thirdparty/squid.git/commit
Support worker-dedicated listening queues (SO_REUSEPORT) (#369)
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Tue, 18 Feb 2020 20:45:00 +0000 (20:45 +0000)
committerAmos Jeffries <yadij@users.noreply.github.com>
Thu, 19 Mar 2020 10:49:01 +0000 (23:49 +1300)
commitab26408197cc125cb9bece34e5936ff77ed10e15
tree70c5ec3f6135fd02440761fe789a3684845189a9
parent81133547aadf8c7ee653f900cf289b535f50fd52
Support worker-dedicated listening queues (SO_REUSEPORT) (#369)

This performance optimization has a few cons, including security
concerns, but it improves CPU core utilization/balance in many SMP
environments and is supported by many high-performance servers. Enabled
by the new `*_port worker-queues` configuration option.

Worker-dedicated listening queues reduce client-worker affinity for
requests submitted over different TCP connections. The effect of that
reduction on Squid performance depends on the environment, but many busy
SMP proxies handling modern traffic should benefit.

TODO: Linux tests show load balancing effects of SO_REUSEPORT, but
untested FreeBSD probably needs SO_REUSEPORT_LB to get those effects.

Recommended reading:
* https://blog.cloudflare.com/the-sad-state-of-linux-socket-balancing/
* https://lwn.net/Articles/542629/
* https://stackoverflow.com/a/14388707
src/anyp/PortCfg.cc
src/anyp/PortCfg.h
src/cache_cf.cc
src/cf.data.pre
src/client_side.cc
src/comm.cc
src/comm/Connection.h
src/ipc/StartListening.cc