aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/blockstore.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2025-10-10 18:09:53 +0200
committerGitHub Enterprise <[email protected]>2025-10-10 18:09:53 +0200
commitc4801320150ea0c492cf343d490a0a339432f060 (patch)
treed3013ef82c1707e38db3abac94d1fec0ca352394 /src/zenstore/blockstore.cpp
parentshorten thread pool names for Linux which has a limit of 15 characters (#563) (diff)
downloadzen-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/zenstore/blockstore.cpp')
-rw-r--r--src/zenstore/blockstore.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/zenstore/blockstore.cpp b/src/zenstore/blockstore.cpp
index 0861baaf8..0fee18420 100644
--- a/src/zenstore/blockstore.cpp
+++ b/src/zenstore/blockstore.cpp
@@ -1688,7 +1688,7 @@ TEST_CASE("blockstore.iterate.chunks")
.Size = DefaultIterateSmallChunkWindowSize * 2};
BlockStoreLocation BadBlockIndex = {.BlockIndex = 0xfffff, .Offset = 1024, .Size = 1024};
- WorkerThreadPool WorkerPool(Max(std::thread::hardware_concurrency() - 1u, 4u));
+ WorkerThreadPool WorkerPool(Max(GetHardwareConcurrency() - 1u, 4u));
std::vector<BlockStoreLocation> Locations{FirstChunkLocation,
SecondChunkLocation,
@@ -1807,7 +1807,7 @@ TEST_CASE("blockstore.thread.read.write")
std::vector<BlockStoreLocation> ChunkLocations;
ChunkLocations.resize(ChunkCount);
- WorkerThreadPool WorkerPool(Max(std::thread::hardware_concurrency() - 1u, 8u));
+ WorkerThreadPool WorkerPool(Max(GetHardwareConcurrency() - 1u, 8u));
{
std::atomic<size_t> WorkCompleted = 0;
Latch L(1);