From: Pieter Lexis Date: Mon, 17 Jul 2017 12:01:06 +0000 (+0200) Subject: rec Add cpu-map setting to new docs X-Git-Tag: rec-4.1.0-alpha1~4^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F5482%2Fhead;p=thirdparty%2Fpdns.git rec Add cpu-map setting to new docs --- diff --git a/pdns/recursordist/docs/performance.rst b/pdns/recursordist/docs/performance.rst index 01113395d7..e0dbb7d1a3 100644 --- a/pdns/recursordist/docs/performance.rst +++ b/pdns/recursordist/docs/performance.rst @@ -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 ---------------- diff --git a/pdns/recursordist/docs/settings.rst b/pdns/recursordist/docs/settings.rst index c25b4f899d..d01ff96fc3 100644 --- a/pdns/recursordist/docs/settings.rst +++ b/pdns/recursordist/docs/settings.rst @@ -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``