Compare commits

...

2 Commits

Author SHA1 Message Date
Ivan Chvets
0d8ba1776f feat: use env var to specify number of cpus for scheduler
Summary of changes:
- Modified code to use env vat to specify number of CPUs for generic scheduler. If not set, system value is taken.

Signed-off-by: Ivan Chvets <ivan.chvets@kinarasystems.com>
2024-06-04 10:01:56 -04:00
Ivan Chvets
bf0a9c1336 feat: use configuration to specify number of cpus
Summary of changes:
- Modified code to use configuration parameter to specify number of CPUs. If not set, system value is taken.

Signed-off-by: Ivan Chvets <ivan.chvets@kinarasystems.com>
2024-06-04 10:01:37 -04:00
2 changed files with 3 additions and 2 deletions

View File

@@ -20,7 +20,8 @@ namespace OpenWifi {
class AP_WS_ReactorThreadPool {
public:
explicit AP_WS_ReactorThreadPool(Poco::Logger &Logger) : Logger_(Logger) {
NumberOfThreads_ = Poco::Environment::processorCount() * 4;
int CPUCount = (int)MicroServiceConfigGetInt("openwifi.system.cpus", Poco::Environment::processorCount());
NumberOfThreads_ = CPUCount * 4;
if (NumberOfThreads_ == 0)
NumberOfThreads_ = 8;
NumberOfThreads_ = std::min(NumberOfThreads_, (std::uint64_t) 128);

View File

@@ -26,7 +26,7 @@ namespace OpenWifi {
private:
GenericScheduler() noexcept
: SubSystemServer("Scheduler", "SCHEDULER", "scheduler"),
Scheduler_(Poco::Environment::processorCount()*2) {
Scheduler_(((int)std::stoi(Poco::Environment::get("GENERIC_SCHEDULER_CORES", std::to_string(Poco::Environment::processorCount()))))*2) {
}
Bosma::Scheduler Scheduler_;