chore: Updating workers

This commit is contained in:
Binyamin Yawitz 2024-07-22 14:45:39 -04:00
parent 916f58cd9d
commit 2947d22392
No known key found for this signature in database
3 changed files with 4 additions and 4 deletions

2
.env
View file

@ -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

View file

@ -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,

View file

@ -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