Fix coroutine HTTP pool sizing

This commit is contained in:
Chirag Aggarwal
2026-04-06 11:07:06 +05:30
parent edb533eaea
commit bf77d52695
3 changed files with 13 additions and 7 deletions
+5
View File
@@ -1,5 +1,10 @@
<?php
// Coroutine HTTP serves requests in a single long-lived process.
putenv('_APP_POOL_PROCESS_COUNT=1');
$_ENV['_APP_POOL_PROCESS_COUNT'] = '1';
$_SERVER['_APP_POOL_PROCESS_COUNT'] = '1';
require_once __DIR__ . '/init.php';
require_once __DIR__ . '/init/span.php';
+2 -1
View File
@@ -246,7 +246,8 @@ $register->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'] ?? '';
Generated
+6 -6
View File
@@ -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",