From bf77d526955a0bba32f3eeb6ee87cebae5d87932 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 6 Apr 2026 11:07:06 +0530 Subject: [PATCH] Fix coroutine HTTP pool sizing --- app/http.php | 5 +++++ app/init/registers.php | 3 ++- composer.lock | 12 ++++++------ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/app/http.php b/app/http.php index 425978d9af..17b2d693d5 100644 --- a/app/http.php +++ b/app/http.php @@ -1,5 +1,10 @@ set('pools', function () { $instanceConnections = $maxConnections / (int) System::getEnv('_APP_POOL_CLIENTS', 14); $workerCount = intval(System::getEnv('_APP_CPU_NUM', swoole_cpu_num())) * intval(System::getEnv('_APP_WORKER_PER_CORE', 6)); - $poolSize = max(1, (int)($instanceConnections / $workerCount)); + $processCount = max(1, (int) System::getEnv('_APP_POOL_PROCESS_COUNT', (string) $workerCount)); + $poolSize = max(1, (int)($instanceConnections / $processCount)); foreach ($connections as $key => $connection) { $type = $connection['type'] ?? ''; diff --git a/composer.lock b/composer.lock index 4c6d50e817..ed2f102456 100644 --- a/composer.lock +++ b/composer.lock @@ -4271,16 +4271,16 @@ }, { "name": "utopia-php/framework", - "version": "0.34.16", + "version": "0.34.17", "source": { "type": "git", "url": "https://github.com/utopia-php/http.git", - "reference": "2b4021ba3f9d476264ce9fd6703d6c79de9add7f" + "reference": "d3e4143b8b06d9823d0c29a06dacefa5a1b93677" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/http/zipball/2b4021ba3f9d476264ce9fd6703d6c79de9add7f", - "reference": "2b4021ba3f9d476264ce9fd6703d6c79de9add7f", + "url": "https://api.github.com/repos/utopia-php/http/zipball/d3e4143b8b06d9823d0c29a06dacefa5a1b93677", + "reference": "d3e4143b8b06d9823d0c29a06dacefa5a1b93677", "shasum": "" }, "require": { @@ -4319,9 +4319,9 @@ ], "support": { "issues": "https://github.com/utopia-php/http/issues", - "source": "https://github.com/utopia-php/http/tree/0.34.16" + "source": "https://github.com/utopia-php/http/tree/0.34.17" }, - "time": "2026-03-20T10:39:07+00:00" + "time": "2026-04-06T04:40:23+00:00" }, { "name": "utopia-php/http",