Skip to content

Distribute queries among threads even on platforms without SO_REUSEPORT_LB

On platforms without load-balancing socket all the queries would be handle by a single thread. This commit adds workaround for such platforms that:

  1. setups single shared listening socket for all listening nmthreads for UDP, TCP and TCPDNS netmgr transports

  2. Calls uv_udp_bind/uv_tcp_bind on the underlying socket just once and for rest of the nmthreads only copy the internal libuv flags (should be UV_HANDLE_BOUND and optionally UV_HANDLE_IPV6).

  3. start reading on UDP socket or listening on TCP socket

The load distribution among the nmthreads is uneven, but it's still better than utilizing just one thread for processing all the incoming queries

Closes #2137 (closed)

Edited by Ondřej Surý

Merge request reports