Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions source/client/process_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,17 @@ class BootstrapFactory : public Envoy::Logger::Loggable<Envoy::Logger::Id::main>
// Determines the concurrency Nighthawk should use based on configuration
// (options) and the available machine resources.
static uint32_t determineConcurrency(const Options& options) {
uint32_t cpu_cores_with_affinity = Envoy::OptionsImplPlatform::getCpuCount();
bool autoscale = options.concurrency() == "auto";
// TODO(oschaaf): Maybe, in the case where the concurrency flag is left out, but
// affinity is set / we don't have affinity with all cores, we should default to autoscale.
// (e.g. we are called via taskset).
uint32_t concurrency = autoscale ? cpu_cores_with_affinity : std::stoi(options.concurrency());

uint32_t concurrency;
if (autoscale) {
uint32_t cpu_cores_with_affinity = Envoy::OptionsImplPlatform::getCpuCount();
ENVOY_LOG(info, "Detected {} (v)CPUs with affinity..", cpu_cores_with_affinity);
concurrency = cpu_cores_with_affinity;
} else {
// TODO(oschaaf): Maybe, in the case where the concurrency flag is left out, but
// affinity is set / we don't have affinity with all cores, we should default to autoscale.
// (e.g. we are called via taskset).
concurrency = std::stoi(options.concurrency());
}
std::string duration_as_string =
options.noDuration() ? "No time limit"
Expand Down
Loading