From c4801320150ea0c492cf343d490a0a339432f060 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Fri, 10 Oct 2025 18:09:53 +0200 Subject: add ability to limit concurrency (#565) effective concurrency in zenserver can be limited via the `--corelimit=` option on the command line. Any value passed in here will be used instead of the return value from `std::thread::hardware_concurrency()` if it is lower. * added --corelimit option to zenserver * made sure thread pools are configured lazily and not during global init * added log output indicating effective and HW concurrency * added change log entry * removed debug logging from ZenEntryPoint::Run() also removed main thread naming on Linux since it makes the output from `top` and similar tools confusing (it shows `main` instead of `zenserver`) --- src/zenutil/include/zenutil/workerpools.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/zenutil/include') diff --git a/src/zenutil/include/zenutil/workerpools.h b/src/zenutil/include/zenutil/workerpools.h index df2033bca..3c388dcbe 100644 --- a/src/zenutil/include/zenutil/workerpools.h +++ b/src/zenutil/include/zenutil/workerpools.h @@ -12,13 +12,13 @@ enum class EWorkloadType Background // Used for background jobs such as GC/Scrub/oplog import-export }; -// Worker pool with std::thread::hardware_concurrency() worker threads, but at least one thread +// Worker pool with GetHardwareConcurrency() worker threads, but at least one thread WorkerThreadPool& GetLargeWorkerPool(EWorkloadType WorkloadType); -// Worker pool with std::thread::hardware_concurrency() / 4 worker threads, but at least one thread +// Worker pool with GetHardwareConcurrency() / 4 worker threads, but at least one thread WorkerThreadPool& GetMediumWorkerPool(EWorkloadType WorkloadType); -// Worker pool with std::thread::hardware_concurrency() / 8 worker threads, but at least one thread +// Worker pool with GetHardwareConcurrency() / 8 worker threads, but at least one thread WorkerThreadPool& GetSmallWorkerPool(EWorkloadType WorkloadType); // Worker pool with minimum number of worker threads, but at least one thread -- cgit v1.2.3