From e2a3ae02e6c2d4c7e4db338cc0cf7c929cf0c21d Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Tue, 3 Dec 2024 16:55:58 +0100 Subject: [PATCH] page_service: enable batching in Rust & Python Tests + Python benchmarks This is the first step towards batching rollout. Refs - rollout https://github.com/neondatabase/cloud/issues/20620 - task https://github.com/neondatabase/neon/issues/9377 - uber-epic: https://github.com/neondatabase/neon/issues/9376 --- libs/pageserver_api/src/config.rs | 9 ++++++++- test_runner/fixtures/neon_fixtures.py | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/libs/pageserver_api/src/config.rs b/libs/pageserver_api/src/config.rs index e49d15ba87a0..09cfbc55fd1c 100644 --- a/libs/pageserver_api/src/config.rs +++ b/libs/pageserver_api/src/config.rs @@ -442,7 +442,14 @@ impl Default for ConfigToml { tenant_config: TenantConfigToml::default(), no_sync: None, wal_receiver_protocol: DEFAULT_WAL_RECEIVER_PROTOCOL, - page_service_pipelining: PageServicePipeliningConfig::Serial, + page_service_pipelining: if !cfg!(test) { + PageServicePipeliningConfig::Serial + } else { + PageServicePipeliningConfig::Pipelined(PageServicePipeliningConfigPipelined { + max_batch_size: NonZeroUsize::new(32).unwrap(), + execution: PageServiceProtocolPipelinedExecutionStrategy::ConcurrentFutures, + }) + }, } } } diff --git a/test_runner/fixtures/neon_fixtures.py b/test_runner/fixtures/neon_fixtures.py index f55f06bebc00..f829855c3dca 100644 --- a/test_runner/fixtures/neon_fixtures.py +++ b/test_runner/fixtures/neon_fixtures.py @@ -1094,6 +1094,13 @@ def __init__(self, config: NeonEnvBuilder): # Disable pageserver disk syncs in tests: when running tests concurrently, this avoids # the pageserver taking a long time to start up due to syncfs flushing other tests' data "no_sync": True, + # Batching (https://github.com/neondatabase/neon/issues/9377): + # enable batching by default in tests and benchmarks. + "page_service_pipelining": { + "mode": "pipelined", + "execution": "concurrent-futures", + "max_batch_size": 32, + }, } if self.pageserver_virtual_file_io_engine is not None: ps_cfg["virtual_file_io_engine"] = self.pageserver_virtual_file_io_engine