From 9e1eb69d5543aef874152c6af32889e3b806850a Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Thu, 6 Oct 2022 18:42:05 +0300 Subject: [PATCH] Increase default compaction_period setting to 20 s. The previous default of 1 s caused excessive CPU usage when there were a lot of projects. Polling every timeline once a second was too aggressive so let's reduce it. Fixes https://github.com/neondatabase/neon/issues/2542, but we probably also want do to something so that we don't poll timelines that have received no new WAL or layers since last check. --- pageserver/src/tenant_config.rs | 2 +- test_runner/regress/test_tenant_conf.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pageserver/src/tenant_config.rs b/pageserver/src/tenant_config.rs index 4c5d5cc3f3..dc1b9353a6 100644 --- a/pageserver/src/tenant_config.rs +++ b/pageserver/src/tenant_config.rs @@ -24,7 +24,7 @@ pub mod defaults { // This parameter determines L1 layer file size. pub const DEFAULT_COMPACTION_TARGET_SIZE: u64 = 128 * 1024 * 1024; - pub const DEFAULT_COMPACTION_PERIOD: &str = "1 s"; + pub const DEFAULT_COMPACTION_PERIOD: &str = "20 s"; pub const DEFAULT_COMPACTION_THRESHOLD: usize = 10; pub const DEFAULT_GC_HORIZON: u64 = 64 * 1024 * 1024; diff --git a/test_runner/regress/test_tenant_conf.py b/test_runner/regress/test_tenant_conf.py index c6cf416d12..46a945a58b 100644 --- a/test_runner/regress/test_tenant_conf.py +++ b/test_runner/regress/test_tenant_conf.py @@ -54,7 +54,7 @@ tenant_config={checkpoint_distance = 10000, compaction_target_size = 1048576}""" for i in { "checkpoint_distance": 10000, "compaction_target_size": 1048576, - "compaction_period": 1, + "compaction_period": 20, "compaction_threshold": 10, "gc_horizon": 67108864, "gc_period": 100, @@ -74,7 +74,7 @@ tenant_config={checkpoint_distance = 10000, compaction_target_size = 1048576}""" for i in { "checkpoint_distance": 20000, "compaction_target_size": 1048576, - "compaction_period": 1, + "compaction_period": 20, "compaction_threshold": 10, "gc_horizon": 67108864, "gc_period": 30, @@ -102,7 +102,7 @@ tenant_config={checkpoint_distance = 10000, compaction_target_size = 1048576}""" for i in { "checkpoint_distance": 15000, "compaction_target_size": 1048576, - "compaction_period": 1, + "compaction_period": 20, "compaction_threshold": 10, "gc_horizon": 67108864, "gc_period": 80, @@ -125,7 +125,7 @@ tenant_config={checkpoint_distance = 10000, compaction_target_size = 1048576}""" for i in { "checkpoint_distance": 15000, "compaction_target_size": 1048576, - "compaction_period": 1, + "compaction_period": 20, "compaction_threshold": 10, "gc_horizon": 67108864, "gc_period": 80,