Compare commits

...

4 Commits

Author SHA1 Message Date
Louis Dureuil
ee99196c92 Grow by 1TB instead of 1MB 2024-06-05 09:22:58 +02:00
Louis Dureuil
aeef2bae33 Use less of the total budget 2024-06-05 09:22:50 +02:00
Louis Dureuil
7f7d2d0449 Restore budget to what it was 2024-06-05 09:22:39 +02:00
Louis Dureuil
e100292417 Adjust default budget to relieve stress on virtual memory space 2024-06-04 11:10:31 +02:00

View File

@@ -567,16 +567,16 @@ impl IndexScheduler {
tracing::debug!("index budget: {budget}B");
let mut index_count = budget / base_map_size;
if index_count < 2 {
if index_count < 3 {
// take a bit less than half than the budget to make sure we can always afford to open an index
let map_size = (budget * 2) / 5;
// single index of max budget
tracing::debug!("1 index of {map_size}B can be opened simultaneously.");
return IndexBudget { map_size, index_count: 1, task_db_size };
}
// give us some space for an additional index when the cache is already full
// decrement is OK because index_count >= 2.
index_count -= 1;
// give us some space for additional indexes when the cache is already full
// decrement is OK because index_count >= 3.
index_count -= 2;
if index_count > max_index_count {
index_count = max_index_count;
}
@@ -1834,7 +1834,7 @@ mod tests {
task_db_size: 1000 * 1000, // 1 MB, we don't use MiB on purpose.
index_base_map_size: 1000 * 1000, // 1 MB, we don't use MiB on purpose.
enable_mdb_writemap: false,
index_growth_amount: 1000 * 1000, // 1 MB
index_growth_amount: 1000 * 1000 * 1000 * 1000, // 1 TB
index_count: 5,
indexer_config,
autobatching_enabled: true,