diff options
| author | Stefan Boberg <[email protected]> | 2025-10-10 18:09:53 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-10-10 18:09:53 +0200 |
| commit | c4801320150ea0c492cf343d490a0a339432f060 (patch) | |
| tree | d3013ef82c1707e38db3abac94d1fec0ca352394 /src/zenremotestore | |
| parent | shorten thread pool names for Linux which has a limit of 15 characters (#563) (diff) | |
| download | zen-c4801320150ea0c492cf343d490a0a339432f060.tar.xz zen-c4801320150ea0c492cf343d490a0a339432f060.zip | |
add ability to limit concurrency (#565)
effective concurrency in zenserver can be limited via the `--corelimit=<N>` 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`)
Diffstat (limited to 'src/zenremotestore')
| -rw-r--r-- | src/zenremotestore/projectstore/remoteprojectstore.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/zenremotestore/projectstore/remoteprojectstore.cpp b/src/zenremotestore/projectstore/remoteprojectstore.cpp index 0d1e0d93d..727a25ba1 100644 --- a/src/zenremotestore/projectstore/remoteprojectstore.cpp +++ b/src/zenremotestore/projectstore/remoteprojectstore.cpp @@ -3452,9 +3452,8 @@ TEST_CASE_TEMPLATE("project.store.export", std::shared_ptr<RemoteProjectStore> RemoteStore = CreateFileRemoteStore(Options); RemoteProjectStore::RemoteStoreInfo StoreInfo = RemoteStore->GetInfo(); - uint32_t NetworkWorkerCount = Max(std::thread::hardware_concurrency() / 4u, 2u); - uint32_t WorkerCount = - (NetworkWorkerCount < std::thread::hardware_concurrency()) ? Max(std::thread::hardware_concurrency() - NetworkWorkerCount, 4u) : 4u; + uint32_t NetworkWorkerCount = Max(GetHardwareConcurrency() / 4u, 2u); + uint32_t WorkerCount = (NetworkWorkerCount < GetHardwareConcurrency()) ? Max(GetHardwareConcurrency() - NetworkWorkerCount, 4u) : 4u; WorkerThreadPool WorkerPool(WorkerCount); WorkerThreadPool NetworkPool(NetworkWorkerCount); |