From: Tomas Krizek Date: Tue, 28 Jan 2020 14:38:37 +0000 (+0100) Subject: doc/cache: add note explaining cache size choice X-Git-Tag: v5.0.1~3^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dbbb0b73eae4aff8b4acc4e40753eab84fb52180;p=thirdparty%2Fknot-resolver.git doc/cache: add note explaining cache size choice --- diff --git a/ci/respdiff/kresd.config b/ci/respdiff/kresd.config index 7da2eaa4b..583822b1e 100644 --- a/ci/respdiff/kresd.config +++ b/ci/respdiff/kresd.config @@ -7,9 +7,6 @@ net.ipv6=false -- Auto-maintain root TA trust_anchors.add_file('.local/etc/knot-resolver/root.keys') --- Large cache size, so we don't need to flush often --- This can be larger than available RAM, least frequently accessed --- records will be paged out cache.size = 1024 * MB -- Load Useful modules diff --git a/daemon/bindings/cache.rst b/daemon/bindings/cache.rst index c14cbcfd2..eeadb6fcf 100644 --- a/daemon/bindings/cache.rst +++ b/daemon/bindings/cache.rst @@ -20,6 +20,10 @@ For personal and small office use-cases cache size around 100 MB is more than en For large deployments we recommend to run Knot Resolver on a dedicated machine, and to allocate 90% of machine's free memory for resolver's cache. +.. note:: Choosing a cache size that can fit into RAM is important even if the + cache is stored on disk (default). Otherwise, the extra I/O caused by disk + access for missing pages can cause performance issues. + For example, imagine you have a machine with 16 GB of memory. After machine restart you use command ``free -m`` to determine amount of free memory (without swap): diff --git a/etc/config/config.cluster b/etc/config/config.cluster index 1fbc0b84d..d8c6c7023 100644 --- a/etc/config/config.cluster +++ b/etc/config/config.cluster @@ -11,10 +11,8 @@ net.listen('::1', 53, { kind = 'dns'}) net.listen('127.0.0.1', 853, { kind = 'tls' }) net.listen('::1', 853, { kind = 'tls' }) --- Large cache size, so we don't need to flush ever --- This can be larger than available RAM, least frequently accessed --- records will be paged out as long as there's enough disk space to back it -cache.size = 100 * GB +-- Refer to manual for optimal cache size +cache.size = 16 * GB -- Load Useful modules modules = { diff --git a/etc/config/config.isp b/etc/config/config.isp index bf9d65c84..7d00131b3 100644 --- a/etc/config/config.isp +++ b/etc/config/config.isp @@ -8,9 +8,7 @@ net.listen('::1', 53, { kind = 'dns'}) net.listen('127.0.0.1', 853, { kind = 'tls' }) net.listen('::1', 853, { kind = 'tls' }) --- Large cache size, so we don't need to flush often --- This can be larger than available RAM, least frequently accessed --- records will be paged out +-- Refer to manual for optimal cache size cache.size = 4 * GB -- load modules diff --git a/etc/config/config.splitview b/etc/config/config.splitview index 04b47edb6..f2b7cd055 100644 --- a/etc/config/config.splitview +++ b/etc/config/config.splitview @@ -22,9 +22,7 @@ modules = { dns64 = 'fe80::21b:77ff:0:0', } --- Large cache size, so we don't need to flush often --- This can be larger than available RAM, least frequently accessed --- records will be paged out +-- Refer to manual for optimal cache size cache.size = 4 * GB -- Forward everything below `company.cz` to `192.168.1.3`