feat: Coroutine adjustments
This commit is contained in:
parent
b05671b8b3
commit
77b593dae5
5 changed files with 1072 additions and 8 deletions
2
.env
2
.env
|
@ -1,7 +1,7 @@
|
|||
_APP_ENV=development
|
||||
_APP_EDITION=self-hosted
|
||||
_APP_LOCALE=en
|
||||
_APP_WORKER_PER_CORE=6
|
||||
_APP_WORKER_PER_CORE=4
|
||||
_APP_CONSOLE_WHITELIST_ROOT=disabled
|
||||
_APP_CONSOLE_WHITELIST_EMAILS=
|
||||
_APP_CONSOLE_WHITELIST_IPS=
|
||||
|
|
|
@ -29,7 +29,7 @@ ENV VITE_APPWRITE_GROWTH_ENDPOINT=$VITE_APPWRITE_GROWTH_ENDPOINT
|
|||
RUN npm ci
|
||||
RUN npm run build
|
||||
|
||||
FROM appwrite/base:0.7.2 as final
|
||||
FROM appwrite/base:0.9.1 as final
|
||||
|
||||
LABEL maintainer="team@appwrite.io"
|
||||
|
||||
|
|
13
app/http.php
13
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', 6));
|
||||
$workerNumber = swoole_cpu_num() * intval(System::getEnv('_APP_WORKER_PER_CORE', 4));
|
||||
|
||||
$server = new Server('0.0.0.0', '80', [
|
||||
'open_http2_protocol' => true,
|
||||
|
@ -35,17 +35,22 @@ $server = new Server('0.0.0.0', '80', [
|
|||
'package_max_length' => $payloadSize,
|
||||
'buffer_output_size' => $payloadSize,
|
||||
|
||||
// TCP Keep-Alive check
|
||||
'open_tcp_keepalive' => true,
|
||||
'tcp_keepidle' => 4,
|
||||
'tcp_keepinterval' => 1,
|
||||
'tcp_keepcount' => 5,
|
||||
|
||||
// Server
|
||||
// 'log_level' => 0,
|
||||
'dispatch_mode' => 2,
|
||||
'dispatch_mode' => 1,
|
||||
'worker_num' => $workerNumber,
|
||||
'reactor_num' => swoole_cpu_num() * 2,
|
||||
// 'task_worker_num' => $workerNumber,
|
||||
'open_cpu_affinity' => true,
|
||||
|
||||
// Coroutine
|
||||
'enable_coroutine' => true,
|
||||
'max_coroutine' => 10000,
|
||||
'send_yield' => true
|
||||
]);
|
||||
|
||||
$http = new Http($server, $container, 'UTC');
|
||||
|
|
|
@ -530,7 +530,7 @@ $server->onMessage(function (int $connection, string $message) use ($server, $co
|
|||
$authentication->setUnique($session['id'] ?? '');
|
||||
$authentication->setSecret($session['secret'] ?? '');
|
||||
|
||||
$user = $database->getDocument('users', $authorization->getUnique());
|
||||
$user = $database->getDocument('users', $authentication->getUnique());
|
||||
|
||||
if (
|
||||
empty($user->getId()) // Check a document has been found in the DB
|
||||
|
|
1059
docker-compose.local.prod.yml
Normal file
1059
docker-compose.local.prod.yml
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue