Poor performance bind9
jim at rfc1035.com
Wed Dec 8 16:59:17 UTC 2004
>>>>> "Dirk" == Dirk Janssen <dirk at no.netspam.de> writes:
Dirk> When I compile bind without threads, the result is realistic
Dirk> and nearly 30x better:
Dirk> Can anyone explain what's the problem here? Is this a issue
Dirk> of bind9 or of freebsd?
Probably both. When BIND9 runs a threaded server, it goes to a lot of
trouble to lock its data structures to prevent race conditions or
deadlocks. ie To avoid two or more threads writing simultaneously to
the same data structure. This can create lock contention which affects
throughout. For instance threads get blocked because some other thread
is holding a global lock. Later BIND9 releases have less thread
contention than earlier ones and there's still room for improvement.
IIUC this is something ISC is working on for future BIND9 releases.
On top of that, there can be throughput constraints in the OS thread
libraries too: eg locking on internal data structures used by the
process/OS to switch between thread contexts. These vary from platform
to platform and OS release to OS release.
The result is there are trade-offs to make. A threaded name server
running on a multiprocessor should be able to do more than one thing
at a time. For instance, it could load a huge zone and answer queries
while it's doing that. OTOH, the query throughput will be lower. Only
you can decide which is more important for your environment. The
trade-offs may be different if some OS has a better/worse thread
library than the one you're currently using.
More information about the bind-users