• Share
  • Dark
    Light

Performance: Multi-threaded I/O

  • Updated on 20 Sep 2018
  • 1 minute to read
  • Contributors 

Starting in BIND 9.9.0, ISC has made some important changes regarding performance of BIND on multi-core machines.  Among these is internal scaling of network traffic.  This article describes this change.

This feature is not available on the Windows version of BIND 9.

This change is automatically enabled in threaded builds. To find out if you are using a threaded build, see Determining if you are using a threaded build.

Background

Prior to BIND 9.9.0, all incoming packets on a socket were processed by one "listener task" per listen-on statement.

  options {
    listen-on 10.53.0.1;
    listen-on 10.54.0.1;
    listen-on 127.0.0.1;
  };

In this example, the socket for address 10.53.0.1 port 53 would have one listener task, 10.54.0.1 port 53 another, and 127.0.0.1 a third listener task.

d8cebf4b-cc72-43cb-895b-1db669e3ee91.png

These listener tasks take the received query on a UDP socket and hands it out to a waiting "worker task."  

The problem with this approach is that on a machine with a large number of CPU cores available, one task per socket may not be enough.  A very common situation is to have server which listens mostly on one address, or perhaps two.  The one socket task quickly becomes saturated, causing one CPU core to reach nearly 100% utilization while the remaining cores are underutilized.

The Solution

ISC has altered the socket code to use multiple listener tasks per listen-on statement. Each listen-on line gets its own pool of listener and worker tasks.

46fad3ec-f20a-44d3-a804-e442426df13b.png

With this change, a 4-core machine will have four listener tasks, each delivering work to any of the four worker tasks available.  The number of listener tasks (per listen-on statement) defaults to the number of detected CPU cores, but may be changed using a command-line option.

Configuration

This change is automatically enabled.  You will see a line similar to "using 4 UDP listeners per interface" in your log file when this feature is in use.

You may also alter the number of listener tasks per socket by using the "-U" option.  You may decrease the number (down to one) but you may not increase it beyond the number of cores detected.

Problems with this site? Email us at marketing@isc.org