1
0
Fork 0
mirror of synced 2024-10-02 02:07:04 +13:00

Update env default max connections

This commit is contained in:
Jake Barnby 2022-11-15 20:36:04 +13:00
parent af391b8f7a
commit c4be0260c3
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C

View file

@ -1133,7 +1133,7 @@ function getWorkerPoolSize(): int
{ {
$reservedConnections = APP_DEFAULT_POOL_SIZE; // Pool of default size is reserved for the HTTP API $reservedConnections = APP_DEFAULT_POOL_SIZE; // Pool of default size is reserved for the HTTP API
$workerCount = swoole_cpu_num() * intval(App::getEnv('_APP_WORKER_PER_CORE', 6)); $workerCount = swoole_cpu_num() * intval(App::getEnv('_APP_WORKER_PER_CORE', 6));
$maxConnections = App::getenv('_APP_DB_MAX_CONNECTIONS', 1001); $maxConnections = App::getenv('_APP_DB_MAX_CONNECTIONS', 251);
$workerConnections = $maxConnections - $reservedConnections; $workerConnections = $maxConnections - $reservedConnections;
if ($workerCount > $workerConnections) { if ($workerCount > $workerConnections) {