]> git.ipfire.org Git - thirdparty/squid.git/commit - src/ipc/StartListening.cc
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)
committerSquid Anubis <squid-anubis@squid-cache.org>
Wed, 19 Feb 2020 21:57:25 +0000 (21:57 +0000)
commit7d17a6a6e75d76e71249ac1ac4afc788c21db6f3
treec7b221a9b94db19e16f7a1f29bf41fde1a3101c9
parenta03343c2acbc382a59a176713d5e33387b82f6a9
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