diff --git a/app/http.php b/app/http.php index 61afce3eae5..3a7562ffd12 100644 --- a/app/http.php +++ b/app/http.php @@ -42,7 +42,7 @@ ); $payloadSize = 12 * (1024 * 1024); // 12MB - adding slight buffer for headers and other data that might be sent with the payload - update later with valid testing -$totalWorkers = swoole_cpu_num() * intval(System::getEnv('_APP_WORKER_PER_CORE', 6)); +$totalWorkers = intval(System::getEnv('_APP_CPU_NUM', swoole_cpu_num())) * intval(System::getEnv('_APP_WORKER_PER_CORE', 6)); $http ->set([ diff --git a/app/init.php b/app/init.php index c6847610c2c..7f95ac4c25a 100644 --- a/app/init.php +++ b/app/init.php @@ -895,7 +895,7 @@ function (mixed $value) { $multiprocessing = System::getEnv('_APP_SERVER_MULTIPROCESS', 'disabled') === 'enabled'; if ($multiprocessing) { - $workerCount = swoole_cpu_num() * intval(System::getEnv('_APP_WORKER_PER_CORE', 6)); + $workerCount = intval(System::getEnv('_APP_CPU_NUM', swoole_cpu_num())) * intval(System::getEnv('_APP_WORKER_PER_CORE', 6)); } else { $workerCount = 1; } diff --git a/app/realtime.php b/app/realtime.php index 4f87e4dea17..86f9c85fdd0 100644 --- a/app/realtime.php +++ b/app/realtime.php @@ -193,7 +193,7 @@ function getTelemetry(int $workerId): Utopia\Telemetry\Adapter $containerId = uniqid(); $statsDocument = null; -$workerNumber = swoole_cpu_num() * intval(System::getEnv('_APP_WORKER_PER_CORE', 6)); +$workerNumber = intval(System::getEnv('_APP_CPU_NUM', swoole_cpu_num())) * intval(System::getEnv('_APP_WORKER_PER_CORE', 6)); $adapter = new Adapter\Swoole(port: System::getEnv('PORT', 80)); $adapter