From faee36a00cef9a217a839125a76211318a027ec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Verg=C3=A9?= Date: Mon, 28 Jan 2019 10:31:34 +0100 Subject: [PATCH 1/3] Fix default `check_interval` value in compaction docs Since apache/couchdb@58fef34 "feat: bump the compaction daemon check_interval to one hour", the default value is `3600`. --- src/config/compaction.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/compaction.rst b/src/config/compaction.rst index 859f0447..e93e6127 100644 --- a/src/config/compaction.rst +++ b/src/config/compaction.rst @@ -160,7 +160,7 @@ Configuration of Compaction Daemon indexes need to be compacted:: [compaction_daemon] - check_interval = 300 + check_interval = 3600 .. config:option:: min_file_size From 0a51f953ecd9d454c3a88c1e4787611b25548c74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Verg=C3=A9?= Date: Mon, 28 Jan 2019 10:33:06 +0100 Subject: [PATCH 2/3] Try to make `check_interval` explanation clearer We had a hard time finding whether `check_interval` was waited between *each database compaction*, or between *a whole compaction run for all databases*. I propose to make it very explicit. --- src/config/compaction.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/config/compaction.rst b/src/config/compaction.rst index e93e6127..6369f350 100644 --- a/src/config/compaction.rst +++ b/src/config/compaction.rst @@ -157,7 +157,8 @@ Configuration of Compaction Daemon .. config:option:: check_interval The delay, in seconds, between each check for which database and view - indexes need to be compacted:: + indexes need to be compacted. In other words, this delay will occur + after *all* databases and views are compacted (or at least checked):: [compaction_daemon] check_interval = 3600 From 3ab5ac4d6026fccac85417cd019ffff25361b645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Verg=C3=A9?= Date: Mon, 28 Jan 2019 10:34:28 +0100 Subject: [PATCH 3/3] Add missing `snooze_period_ms` in compaction docs This new parameter was introduced in apache/couchdb@e5bf9d4 "add snooze_period doc to default.ini" and changed in apache/couchdb@5471694 "Add snooze_period_ms for finer tuning". --- src/config/compaction.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/config/compaction.rst b/src/config/compaction.rst index 6369f350..89efe193 100644 --- a/src/config/compaction.rst +++ b/src/config/compaction.rst @@ -172,6 +172,17 @@ Configuration of Compaction Daemon [compaction_daemon] min_file_size = 131072 + .. config:option:: snooze_period_ms + + With lots of databases and/or with lots of design docs in one or more + databases, the compaction_daemon can create significant CPU load when + checking whether databases and view indexes need compacting. The + ``snooze_period_ms`` setting ensures a smoother CPU load. Defaults to + 3000 milliseconds wait. + + [compaction_daemon] + snooze_period_ms = 3000 + .. _config/view_compaction: Views Compaction Options