diff --git a/crates/index-scheduler/src/index_mapper/index_map.rs b/crates/index-scheduler/src/index_mapper/index_map.rs index f8080d23b..4114d9947 100644 --- a/crates/index-scheduler/src/index_mapper/index_map.rs +++ b/crates/index-scheduler/src/index_mapper/index_map.rs @@ -305,7 +305,7 @@ fn create_or_open_index( options.map_size(clamp_to_page_size(map_size)); options.max_readers(1024); if enable_mdb_writemap { - unsafe { options.flags(EnvFlags::WRITE_MAP) }; + unsafe { options.flags(EnvFlags::WRITE_MAP | EnvFlags::MAP_ASYNC) }; } if let Some((created, updated)) = date { diff --git a/workloads/movies-writemap.json b/workloads/movies-writemap.json new file mode 100644 index 000000000..60e0d9814 --- /dev/null +++ b/workloads/movies-writemap.json @@ -0,0 +1,42 @@ +{ + "name": "movies.json,usewritemap", + "run_count": 10, + "extra_cli_args": ["--experimental-reduce-indexing-memory-usage"], + "assets": { + "movies.json": { + "local_location": null, + "remote_location": "https://milli-benchmarks.fra1.digitaloceanspaces.com/bench/datasets/movies.json", + "sha256": "5b6e4cb660bc20327776e8a33ea197b43d9ec84856710ead1cc87ab24df77de1" + } + }, + "commands": [ + { + "route": "indexes/movies/settings", + "method": "PATCH", + "body": { + "inline": { + "searchableAttributes": [ + "title", + "overview" + ], + "filterableAttributes": [ + "genres", + "release_date" + ], + "sortableAttributes": [ + "release_date" + ] + } + }, + "synchronous": "DontWait" + }, + { + "route": "indexes/movies/documents", + "method": "POST", + "body": { + "asset": "movies.json" + }, + "synchronous": "WaitForTask" + } + ] +}