SQLite read pool maps 64 MB and caches up to 32 MB: size it by measurement #283

Open
opened 2026-10-06 02:40:29 +00:00 by yonlu · 1 comment
Owner

backend/database opens the read pool with cache_size(-8000) and mmap_size(67108864) on each of readPoolConns = 4 connections.

Measured on a 371 MB yj.db (2026-10-05): the mmap accounts for 64–66 MB of the process's RSS (RssShmem, all of it the first 64 MB of the file, which is mostly explore_index), and the page caches can reach ~34 MB. The mmap is reclaimable page cache rather than real pressure, but it is a third of the backend's reported footprint and the number users see.

Proposed

Measure Explore search and the library queries with make perf at a smaller mmap_size (16 MB / 0) and cache_size (-2000), and take the smallest setting that does not move them.

`backend/database` opens the read pool with `cache_size(-8000)` and `mmap_size(67108864)` on each of `readPoolConns = 4` connections. Measured on a 371 MB `yj.db` (2026-10-05): the mmap accounts for 64–66 MB of the process's RSS (`RssShmem`, all of it the first 64 MB of the file, which is mostly `explore_index`), and the page caches can reach ~34 MB. The mmap is reclaimable page cache rather than real pressure, but it is a third of the backend's reported footprint and the number users see. ### Proposed Measure Explore search and the library queries with `make perf` at a smaller `mmap_size` (16 MB / 0) and `cache_size` (-2000), and take the smallest setting that does not move them.
yonlu added the
Priority
Low
4
Kind/EnhancementPlatform/DesktopPlatform/Android
labels 2026-10-06 02:40:29 +00:00
yonlu self-assigned this 2026-10-06 02:40:46 +00:00
yonlu added the
Status
In Progress
label 2026-10-06 02:40:46 +00:00
Author
Owner

Plan 023 (scoped library payloads), in order 279 → 281 → 280 → 282, then 283 and 284. Measured before/after with make perf against the bulk seed.

Plan 023 (scoped library payloads), in order 279 → 281 → 280 → 282, then 283 and 284. Measured before/after with make perf against the bulk seed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: yonlu/yellowjacket#283