From f1f245a31686802db4ea65969a088f1f4e0ea37a Mon Sep 17 00:00:00 2001 From: Vlad Lazar Date: Wed, 2 Oct 2024 14:10:55 +0100 Subject: [PATCH] review: add coment for max vec read bytes constant --- libs/pageserver_api/src/config.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/pageserver_api/src/config.rs b/libs/pageserver_api/src/config.rs index c9787c46e31c8..0063942c06f7e 100644 --- a/libs/pageserver_api/src/config.rs +++ b/libs/pageserver_api/src/config.rs @@ -296,6 +296,12 @@ pub mod defaults { pub const DEFAULT_INGEST_BATCH_SIZE: u64 = 100; + // Soft limit for the maximum size of a vectored read. + // This is determined by the largest NeonWalRecord that can exist (minus dbdir and reldir keys + // which are unbounded). As of this writing, that is a `NeonWalRecord::ClogSetCommitted` record, + // with 32k xids. That's the max number of XIDS on a single CLOG page. The size of such a record + // is `sizeof(Transactionid) * 32768 + (some fixed overhead from 'timestamp`, the Vec length and whatever extra serde serialization adds)`. + // That is, slightly above 128 kB. pub const DEFAULT_MAX_VECTORED_READ_BYTES: usize = 130 * 1024; // 130 KiB pub const DEFAULT_IMAGE_COMPRESSION: ImageCompressionAlgorithm =