Skip to content

Commit

Permalink
chore: tweak batch deletion concurrency (#16770)
Browse files Browse the repository at this point in the history
* chore: tweak batch deletion concurrency

* chore: tweak remove file in batch thread pool size
  • Loading branch information
dantengsky authored Nov 5, 2024
1 parent b89a604 commit d2e4dca
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/query/storages/common/io/src/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,15 @@ impl Files {
.map(|location| Self::delete_files(self.operator.clone(), location.to_vec()))
});

// At most 3 concurrent batch deletions allowed, mitigate rate limit errors
let permit = (threads_nums / 2).clamp(1, 3);

// IO tasks, 2 threads should be enough
let pool_thread_number = 2;
execute_futures_in_parallel(
tasks,
threads_nums,
threads_nums * 2,
pool_thread_number,
permit,
"batch-remove-files-worker".to_owned(),
)
.await?
Expand Down

0 comments on commit d2e4dca

Please sign in to comment.