From: Otto Moerbeek Date: Wed, 19 Jun 2024 09:35:15 +0000 (+0200) Subject: rec: describe (roughly) memory usage X-Git-Tag: rec-5.2.0-alpha0~9^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F14358%2Fhead;p=thirdparty%2Fpdns.git rec: describe (roughly) memory usage Also fix a few refs --- diff --git a/pdns/recursordist/docs/performance.rst b/pdns/recursordist/docs/performance.rst index c023c11ae0..fcfd67157f 100644 --- a/pdns/recursordist/docs/performance.rst +++ b/pdns/recursordist/docs/performance.rst @@ -110,6 +110,32 @@ When running with >3000 queries per second, and running Linux versions prior to This is solved by rebooting with ``clock=tsc`` or upgrading to a 2.6.17 kernel. This is relevant if dmesg shows ``Using pmtmr for high-res timesource``. +Memory usage +------------ + +:program:`Recursor` keeps all the data it needs in memory. +The default configuration uses a little more than 1GB when the caches are full. +Depending on configuration, memory usage can amount to many gigabytes for a large installation. + +.. warning:: + Avoid swapping. The memory access patterns of :program:`Recursor` are random. This means + that it will cause trashing (the OS spending lots of time pulling in and writing out memory + pages) if :program:`Recursor` uses more physical memory than available and performance will be severely impacted. + +Below the memory usage observed for a specific test case are described. +Please note that depending on OS, version of system libraries, version of the :program:`Recursor`, features used and usage patterns these numbers may vary. +Test and observe your system to learn more about the memory requirements specific to your case. + +The most important subsystems that use memory are: + +- The packet cache. The amount of memory used in a test case was about 500 bytes per entry +- The record cache. The amount of memory used in a test case was about 850 bytes per entry +- Authoritative zones loaded. Memory usage is dependent on the size and number loaded. +- RPZ zones loaded. Memory usage is dependent on the size and number loaded. +- NOD DBs. Memory usage is dependent on specific settings of this subsystem. + +An estimate for the memory used by its caches for a :program:`Recursor` having 2 million record cache entries and 1 million packet cache entries is ``2e6 * 850 * + 1e6 * 500 = about 2GB``. + Connection tracking and firewalls --------------------------------- diff --git a/pdns/recursordist/settings/table.py b/pdns/recursordist/settings/table.py index 73ed91872d..e029d9c072 100644 --- a/pdns/recursordist/settings/table.py +++ b/pdns/recursordist/settings/table.py @@ -1816,7 +1816,7 @@ feature. 'doc' : ''' Path to a file with a list of domains. File should have one domain per line, with no extra characters or comments. -See :doc:`ignore_list`. +See :ref:`setting-new-domain-ignore-list`. ''', 'versionadded': '5.1.0' }, @@ -1843,7 +1843,7 @@ will never be considered for a new unique domain request. 'doc' : ''' Path to a file with a list of domains. File should have one domain per line, with no extra characters or comments. -See :doc:`udr_ignore_list`. +See :ref:`setting-udr-ignore-list`. ''', 'versionadded': '5.1.0' },