Knowledge Base ISC Main Website Ask a Question/Contact ISC
Performance: Multi-threaded I/O
Author: Michael Graff Reference Number: AA-00629 Views: 8884 Created: 2012-02-24 18:17 Last Updated: 2012-11-06 11:37 0 Rating/ Voters

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.

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.


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.


© 2001-2014 Internet Systems Consortium

Feedback
  • Please help us to improve the content of our knowledge base by letting us know how we can improve this article or by submitting suggestions for other articles you'd like to see created. Information on how to obtain further help on our products or services can be found on our main website.' If you have a technical question or problem on which you'd like help, we recommend searching our community mailing list archives and/or posting your question there (you will need to register there first for your posts to be accepted). The bind-users and the dhcp-users lists particularly have a long-standing and active membership.
Info Submit Feedback on this Article
Nickname: Your Email: Subject: Comment:
Enter the code below:
Quick Jump Menu