From: Tomas Krizek Date: Mon, 2 Dec 2019 17:01:10 +0000 (+0100) Subject: doc/operators-guide: add cache recommendations X-Git-Tag: v5.0.0~8^2~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=547b31c4a6a6ca9156bb94bc4e402e5dd4cca566;p=thirdparty%2Fknot-resolver.git doc/operators-guide: add cache recommendations --- diff --git a/doc/operators-guide.rst b/doc/operators-guide.rst index 751b789f2..cd40fd52a 100644 --- a/doc/operators-guide.rst +++ b/doc/operators-guide.rst @@ -88,5 +88,41 @@ individual services for classic DNS, DoT and DoH from each other. end +Cache +===== + +Cache size +---------- + +Increasing the cache size is suitable for larger deployments. Values of 1 GB or +larger should be considered. + +.. code-block:: lua + + cache.size = 1 * GB + +Ensure sufficient space is available on the filesystem, otherwise a runtime +error of ``SIGBUS`` will be raised when Knot Resolver tries to allocate more +space. + +Cache in tmpfs +-------------- + +.. tip:: Using tmpfs for cache improves performance and reduces disk I/O. + +Mounting the cache directory as tmpfs is recommended for larger deployments. +Make sure to use appropriate ``size=`` option and don't forget to adjust the +size in the config file as well. + +.. code-block:: + + # /etc/fstab + tmpfs /var/cache/knot-resolver tmpfs rw,size=1G,uid=knot-resolver,gid=knot-resolver,nosuid,nodev,noexec,mode=0700 0 0 + +.. note:: While it is technically possible to move the cache to an existing + tmpfs filesystem, it is *not* recommended. The path to cache is specified in + multiple systemd units. Also, a shared tmpfs space could be used up by other + applications, leading to ``SIGBUS`` errors during runtime. + .. _`supervisord`: http://supervisord.org/