1
0
Fork 0
mirror of synced 2024-09-21 20:11:15 +12:00

Enabled coroutines

This commit is contained in:
Eldad Fux 2024-04-03 13:43:20 +02:00
parent a1db69b7e7
commit bd57955168

View file

@ -5,6 +5,7 @@ require_once __DIR__ . '/../vendor/autoload.php';
use Appwrite\Utopia\Request; use Appwrite\Utopia\Request;
use Appwrite\Utopia\Response; use Appwrite\Utopia\Response;
use Swoole\Process; use Swoole\Process;
use Swoole\Runtime;
use Utopia\Abuse\Adapters\TimeLimit; use Utopia\Abuse\Adapters\TimeLimit;
use Utopia\Audit\Audit; use Utopia\Audit\Audit;
use Utopia\CLI\Console; use Utopia\CLI\Console;
@ -22,6 +23,11 @@ use Utopia\Pools\Group;
$payloadSize = 6 * (1024 * 1024); // 6MB $payloadSize = 6 * (1024 * 1024); // 6MB
$workerNumber = swoole_cpu_num() * intval(Http::getEnv('_APP_WORKER_PER_CORE', 6)); $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'; include __DIR__ . '/controllers/general.php';
$http = new Http(new Server('0.0.0.0', Http::getEnv('PORT', 80), [ $http = new Http(new Server('0.0.0.0', Http::getEnv('PORT', 80), [