Skip to content

Commit d3aa7b6

Browse files
committed
disable page pool by making its capacity 1 page
1 parent ee91dbf commit d3aa7b6

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

crates/table/src/page_pool.rs

+13-4
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,24 @@ impl MemoryUsage for PagePool {
2424

2525
impl PagePool {
2626
pub fn new_for_test() -> Self {
27-
Self::new(None)
27+
Self::new(Some(100 * size_of::<Page>()))
2828
}
2929

3030
/// Returns a new page pool with `max_size` bytes rounded down to the nearest multiple of 64 KiB.
3131
///
32-
/// if no size is provided, a default of 8 GiB is used.
32+
/// if no size is provided, a default of 1 page is used.
3333
pub fn new(max_size: Option<usize>) -> Self {
34-
const DEFAULT_MAX_SIZE: usize = 8 * (1 << 30); // 8 GiB
35-
const PAGE_SIZE: usize = 64 * (1 << 10); // 64 KiB, `size_of::<Page>()`
34+
const PAGE_SIZE: usize = size_of::<Page>();
35+
// TODO(centril): This effectively disables the page pool.
36+
// Currently, we have a test `test_index_scans`.
37+
// The test sets up a `Location` table, like in BitCraft, with a `chunk` field,
38+
// and populates it with 1000 different chunks with 1200 rows each.
39+
// Then it asserts that the cold latency of an index scan on `chunk` takes < 1 ms.
40+
// However, for reasons currently unknown to us,
41+
// a large page pool, with capacity `1 << 26` bytes, on i7-7700K, 64GB RAM,
42+
// will turn the latency into 30-40 ms.
43+
// As a precaution, we disable the page pool by default.
44+
const DEFAULT_MAX_SIZE: usize = PAGE_SIZE; // 1 page
3645

3746
let queue_size = max_size.unwrap_or(DEFAULT_MAX_SIZE) / PAGE_SIZE;
3847
let inner = Arc::new(PagePoolInner::new(queue_size));

crates/testing/src/modules.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ pub static DEFAULT_CONFIG: Config = Config {
226226
/// For performance tests, do not persist to disk.
227227
pub static IN_MEMORY_CONFIG: Config = Config {
228228
storage: Storage::Disk,
229-
// For some reason, `None`, i.e., 8 GiB capacity causes `test_index_scans`
230-
// to slow down, and makes the perf test for `chunk` go over 1ms.
229+
// For some reason, a large page pool capacity causes `test_index_scans` to slow down,
230+
// and makes the perf test for `chunk` go over 1ms.
231231
// The threshold for failure on i7-7700K, 64GB RAM seems to be at 1 << 26.
232232
// TODO(centril): investigate further why this size affects the benchmark.
233233
page_pool_max_size: Some(1 << 16),

0 commit comments

Comments
 (0)