aboutsummaryrefslogtreecommitdiff
path: root/src/db/open.rs
diff options
context:
space:
mode:
authorQuentin <quentin@dufour.io>2024-08-18 12:25:35 +0000
committerQuentin <quentin@dufour.io>2024-08-18 12:25:35 +0000
commit679ae8bcbb234623eed83dd10bb9d051eefead4a (patch)
tree73f92f0ba14374dec710b5912f259142079ed873 /src/db/open.rs
parent3a87bd1370eb9fefc67deec9d7dfa2187ddf9763 (diff)
parent2a93ad0c8481c02c0446f97ef3c14882e87aebc5 (diff)
downloadgarage-679ae8bcbb234623eed83dd10bb9d051eefead4a.tar.gz
garage-679ae8bcbb234623eed83dd10bb9d051eefead4a.zip
Merge pull request 'Set "no read ahead" on LMDB to improve performances when "LMDB size" > "RAM size"' (#855) from fix-lmdb-no-read-ahead into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/855 Reviewed-by: Alex <alex@adnab.me>
Diffstat (limited to 'src/db/open.rs')
-rw-r--r--src/db/open.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/db/open.rs b/src/db/open.rs
index b8de3cd7..ff3bc830 100644
--- a/src/db/open.rs
+++ b/src/db/open.rs
@@ -92,6 +92,7 @@ pub fn open_db(path: &PathBuf, engine: Engine, opt: &OpenOpt) -> Result<Db> {
env_builder.map_size(map_size);
env_builder.max_readers(2048);
unsafe {
+ env_builder.flag(crate::lmdb_adapter::heed::flags::Flags::MdbNoRdAhead);
env_builder.flag(crate::lmdb_adapter::heed::flags::Flags::MdbNoMetaSync);
if !opt.fsync {
env_builder.flag(heed::flags::Flags::MdbNoSync);