]> granicus.if.org Git - pdns/commitdiff
rec Add cpu-map setting to new docs
authorPieter Lexis <pieter.lexis@powerdns.com>
Mon, 17 Jul 2017 12:01:06 +0000 (14:01 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 17 Jul 2017 12:11:47 +0000 (14:11 +0200)
pdns/recursordist/docs/performance.rst
pdns/recursordist/docs/settings.rst

index 01113395d7ff2d2f3aef8435ca12b088debaa21e..e0dbb7d1a371a946901235d3a88d5899331989c5 100644 (file)
@@ -29,6 +29,9 @@ This prevents a single thread from having to handle every incoming queries, but
 
 If ``SO_REUSEPORT`` support is available and :ref:`setting-reuseport` is set to true, separate listening sockets are opened for each worker thread and the query distributions is handled by the kernel, avoiding any thundering herd issue as well as preventing the distributor thread from becoming the bottleneck.
 
+.. versionadded:: 4.1.0
+   The :ref:`setting-cpu-map` parameter can be used to pin worker threads to specific CPUs, in order to keep caches as warm as possible and optimize memory access on NUMA systems.
+
 Performance tips
 ----------------
 
index c25b4f899d803c637fb8619b595136b54e76da1c..d01ff96fc3be5a2af7a2a4dd2ca225264e75bebb 100644 (file)
@@ -200,6 +200,27 @@ Usually ``/etc/powerdns``, but this depends on ``SYSCONFDIR`` during compile-tim
 
 When running multiple recursors on the same server, read settings from :file:`recursor-{name}.conf`, this will also rename the binary image.
 
+.. _setting-cpu-map:
+
+``cpu-map``
+-----------
+.. versionadded:: 4.1.0
+
+- String
+- Default: unset
+
+Set CPU affinity for worker threads, asking the scheduler to run those threads on a single CPU, or a set of CPUs.
+This parameter accepts a space separated list of thread-id=cpu-id, or thread-id=cpu-id-1,cpu-id-2,...,cpu-id-N.
+For example, to make the worker thread 0 run on CPU id 0 and the worker thread 1 on CPUs 1 and 2::
+
+  cpu-map=0=0 1=1,2
+
+The number of worker threads is determined by the :ref:`setting-threads` setting.
+If :ref:`setting-pdns-distributes-queries` is set, an additional thread is started, assigned the id 0,
+and is the only one listening on client sockets and accepting queries, distributing them to the other worker threads afterwards.
+
+This parameter is only available on OS that provides the `pthread_setaffinity_np()` function.
+
 .. _setting-daemon:
 
 ``daemon``