file tier: STRATA_UNBUFFERED_LOAD=1 is not honoured without a RAM budget

Review of #773 (2 x RTX 5060 Ti 16 GB, 32 GB RAM, --mmap-experts, no --resident-budget-gib): with no RAM copy the
file cache is the expert tier, and forcing unbuffered reads there re-read 163-629 GB from the drive and halved the
speed. The automatic decision never armed in that mode; now the forced one does not either, and the log says so.
This commit is contained in:
Pc1 authored and Niko1221 committed 2026-10-05 15:58:38 +02:00
1 parent 2d929a28b3
commit 066094c81f
1 file changed
+8 -1
+8 -1
View File
@@ -3419,11 +3419,18 @@ int main(int argc, char** argv) {
// #286: with a RAM budget the hottest experts live in it, and the rest are read from the drive unbuffered
// when the file cache could not keep them beside the budget anyway (a 32 GB PC) - the mapped reads' page
// faults are small requests on the critical path, and their pages take the RAM the budget was sized for
if (o.resident_budget > 0 || std::getenv("STRATA_UNBUFFERED_LOAD") != nullptr) {
// #773: without a RAM budget there is no RAM copy and the file cache IS the expert tier (measured on a
// 32 GB, 2 x 16 GB rig: forcing unbuffered reads there re-read 163-629 GB from the drive and halved the
// speed), so STRATA_UNBUFFERED_LOAD=1 is not honoured in that mode
if (o.resident_budget > 0) {
std::string why;
const bool ub = src.set_unbuffered(o.resident_budget, why);
std::fprintf(stderr, "strata generate: the file tier reads %s (%s)\n",
ub ? "unbuffered" : "through the file cache", why.c_str());
} else if (const char* env = std::getenv("STRATA_UNBUFFERED_LOAD"); env != nullptr && env[0] != '\0' &&
env[0] != '0') {
std::fprintf(stderr, "strata generate: the file tier reads through the file cache (STRATA_UNBUFFERED_LOAD=%s "
"ignored: without --resident-budget-gib the file cache holds the experts)\n", env);
}
srcp = &src;
} else {