File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 20
20
namespace CPUCores
21
21
{
22
22
UInt16 number_of_logical_cpu_cores = std::thread::hardware_concurrency();
23
- UInt16 number_of_physical_cpu_cores = std::thread::hardware_concurrency() / 2 ;
23
+ // physical cpu cores should not be 0
24
+ UInt16 number_of_physical_cpu_cores = std::max<UInt16>(1 , std::thread::hardware_concurrency() / 2 );
24
25
} // namespace CPUCores
25
26
26
27
Original file line number Diff line number Diff line change @@ -1220,7 +1220,7 @@ try
1220
1220
{
1221
1221
auto size = settings.grpc_completion_queue_pool_size ;
1222
1222
if (size == 0 )
1223
- size = std::thread::hardware_concurrency ();
1223
+ size = getNumberOfLogicalCPUCores ();
1224
1224
GRPCCompletionQueuePool::global_instance = std::make_unique<GRPCCompletionQueuePool>(size);
1225
1225
}
1226
1226
You can’t perform that action at this time.
0 commit comments