From bd57955168b687764f5aea4aa7fc77b2617a1d09 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Wed, 3 Apr 2024 13:43:20 +0200 Subject: [PATCH] Enabled coroutines --- app/http.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/http.php b/app/http.php index 40faabae30..069767f821 100644 --- a/app/http.php +++ b/app/http.php @@ -5,6 +5,7 @@ require_once __DIR__ . '/../vendor/autoload.php'; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; use Swoole\Process; +use Swoole\Runtime; use Utopia\Abuse\Adapters\TimeLimit; use Utopia\Audit\Audit; use Utopia\CLI\Console; @@ -22,6 +23,11 @@ use Utopia\Pools\Group; $payloadSize = 6 * (1024 * 1024); // 6MB $workerNumber = swoole_cpu_num() * intval(Http::getEnv('_APP_WORKER_PER_CORE', 6)); +// Unlimited memory limit to handle as many coroutines/requests as possible +ini_set('memory_limit', '-1'); + +Runtime::enableCoroutine(true, SWOOLE_HOOK_ALL); + include __DIR__ . '/controllers/general.php'; $http = new Http(new Server('0.0.0.0', Http::getEnv('PORT', 80), [