diff --git a/.env b/.env index ba50a84508..9cccf5ee7e 100644 --- a/.env +++ b/.env @@ -1,7 +1,7 @@ _APP_ENV=development _APP_EDITION=self-hosted _APP_LOCALE=en -_APP_WORKER_PER_CORE=2 +_APP_WORKER_PER_CORE=6 _APP_CONSOLE_WHITELIST_ROOT=disabled _APP_CONSOLE_WHITELIST_EMAILS= _APP_CONSOLE_SESSION_ALERTS=enabled diff --git a/app/http.php b/app/http.php index 284c1a244a..00b7fdbec3 100644 --- a/app/http.php +++ b/app/http.php @@ -26,7 +26,7 @@ use Utopia\System\System; global $global, $container; $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 -$workerNumber = swoole_cpu_num() * intval(System::getEnv('_APP_WORKER_PER_CORE', 2)); +$workerNumber = swoole_cpu_num() * intval(System::getEnv('_APP_WORKER_PER_CORE', 6)); $server = new Server('0.0.0.0', '80', [ 'open_http2_protocol' => true, @@ -36,7 +36,7 @@ $server = new Server('0.0.0.0', '80', [ 'buffer_output_size' => $payloadSize, // Server // 'log_level' => 0, - 'dispatch_mode' => 1, + 'dispatch_mode' => 2, 'worker_num' => $workerNumber, 'reactor_num' => swoole_cpu_num() * 2, 'open_cpu_affinity' => true, diff --git a/app/realtime.php b/app/realtime.php index 9c705ba9d5..695060f772 100644 --- a/app/realtime.php +++ b/app/realtime.php @@ -61,7 +61,7 @@ $stats->create(); $containerId = uniqid(); $statsDocument = null; -$workerNumber = swoole_cpu_num() * intval(System::getEnv('_APP_WORKER_PER_CORE', 2)); +$workerNumber = swoole_cpu_num() * intval(System::getEnv('_APP_WORKER_PER_CORE', 6)); $adapter = new Adapter\Swoole(port: System::getEnv('PORT', 80)); $adapter