mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
Merge pull request #9177 from appwrite/PLA-2158
feat(swoole): allow configuration override of available cpus
This commit is contained in:
commit
eb8ca0229a
3 changed files with 3 additions and 3 deletions
|
|
@ -42,7 +42,7 @@ $http = new Server(
|
||||||
);
|
);
|
||||||
|
|
||||||
$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
|
$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
|
||||||
$totalWorkers = swoole_cpu_num() * intval(System::getEnv('_APP_WORKER_PER_CORE', 6));
|
$totalWorkers = intval(System::getEnv('_APP_CPU_NUM', swoole_cpu_num())) * intval(System::getEnv('_APP_WORKER_PER_CORE', 6));
|
||||||
|
|
||||||
$http
|
$http
|
||||||
->set([
|
->set([
|
||||||
|
|
|
||||||
|
|
@ -895,7 +895,7 @@ $register->set('pools', function () {
|
||||||
$multiprocessing = System::getEnv('_APP_SERVER_MULTIPROCESS', 'disabled') === 'enabled';
|
$multiprocessing = System::getEnv('_APP_SERVER_MULTIPROCESS', 'disabled') === 'enabled';
|
||||||
|
|
||||||
if ($multiprocessing) {
|
if ($multiprocessing) {
|
||||||
$workerCount = swoole_cpu_num() * intval(System::getEnv('_APP_WORKER_PER_CORE', 6));
|
$workerCount = intval(System::getEnv('_APP_CPU_NUM', swoole_cpu_num())) * intval(System::getEnv('_APP_WORKER_PER_CORE', 6));
|
||||||
} else {
|
} else {
|
||||||
$workerCount = 1;
|
$workerCount = 1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -193,7 +193,7 @@ $stats->create();
|
||||||
|
|
||||||
$containerId = uniqid();
|
$containerId = uniqid();
|
||||||
$statsDocument = null;
|
$statsDocument = null;
|
||||||
$workerNumber = swoole_cpu_num() * intval(System::getEnv('_APP_WORKER_PER_CORE', 6));
|
$workerNumber = intval(System::getEnv('_APP_CPU_NUM', swoole_cpu_num())) * intval(System::getEnv('_APP_WORKER_PER_CORE', 6));
|
||||||
|
|
||||||
$adapter = new Adapter\Swoole(port: System::getEnv('PORT', 80));
|
$adapter = new Adapter\Swoole(port: System::getEnv('PORT', 80));
|
||||||
$adapter
|
$adapter
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue