refactor: centralize CPU core detection using cgroup-aware utility
Release / create-release (push) Successful in 2m26s
Release / build-linux-x86_64 (push) Successful in 8m13s
Release / build-macos-arm64 (push) Successful in 1m43s
ci.yml / build (pull_request) Canceled after 1h29m17s

Introduce `obisys::effective_parallelism()` to read Linux cgroup v1/v2 CPU quotas from sysfs, preventing thread pool oversubscription in containerized environments. Replace direct `std::thread::available_parallelism()` calls across `obikindex` and `obikmer` with this centralized function. Bump `obikmer` version to 1.1.41.
This commit is contained in:
Eric Coissac committed 2026-08-11 12:23:05 +02:00
1 parent 2e7cfc4368
commit 5f95e866f8
8 files changed
+97 -19

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "obikmer"
version = "1.1.40"
version = "1.1.41"
edition = "2024"
[[bin]]
+1 -3
View File
@@ -38,9 +38,7 @@ pub struct CommonArgs {
#[arg(
short = 'T',
long,
default_value_t = std::thread::available_parallelism()
.map(|n| n.get())
.unwrap_or(1)
default_value_t = obisys::effective_parallelism()
)]
pub threads: usize,
+1 -3
View File
@@ -70,9 +70,7 @@ pub struct QueryArgs {
#[arg(
short = 'T',
long,
default_value_t = std::thread::available_parallelism()
.map(|n| n.get())
.unwrap_or(1)
default_value_t = obisys::effective_parallelism()
)]
pub threads: usize,