@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

For now, disable persistent connections and the "max_connections" setup warning

Summary:
Ref T11672. At low loads, this causes us to use more connections, which is pushing some installs over the default limits.

Rather than trying to walk users through changing `max_connections`, `open_files_limit`, `fs.file-max`, `ulimit`, etc., just put things back for now. After T11044 we should have headroom to use persistent connections within the default limits on all reasonable systems..

Test Plan: Loaded Phabricator, poked around.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11672

Differential Revision: https://secure.phabricator.com/D16591

+7 -35
-34
src/applications/config/check/PhabricatorMySQLSetupCheck.php
··· 44 44 ->addMySQLConfig('max_allowed_packet'); 45 45 } 46 46 47 - $max_connections = self::loadRawConfigValue('max_connections'); 48 - 49 - // A common default is 150, but we're fairly liberal about the number of 50 - // connections we open and it's easy for us to run far over this limit. 51 - 52 - $warning_threshold = 256; 53 - if ($max_connections < $warning_threshold) { 54 - $message = pht( 55 - 'MySQL is configured with a small "%s" (%d) limit, which may cause '. 56 - 'connection failures long before any resources near exhaustion. '. 57 - 'There is normally very little benefit to enforcing a connection '. 58 - 'limit, and most installs should increase it substantially.'. 59 - "\n\n". 60 - 'You can compute a specific connection limit for your install by '. 61 - 'doing a lot of math with MySQL buffer sizes and RAM available on '. 62 - 'the machine, or just set it to a huge number. In nearly every case, '. 63 - 'setting it to a huge number is entirely reasonable.'. 64 - "\n\n". 65 - 'You can raise this limit by adding this to your %s file (in the %s '. 66 - 'section) and then restarting %s:'. 67 - "\n\n%s", 68 - 'max_connections', 69 - $max_connections, 70 - phutil_tag('tt', array(), 'my.cnf'), 71 - phutil_tag('tt', array(), '[mysqld]'), 72 - phutil_tag('tt', array(), 'mysqld'), 73 - phutil_tag('pre', array(), 'max_connections=100000')); 74 - 75 - $this->newIssue('mysql.max_connections') 76 - ->setName(pht('Small MySQL "%s"', 'max_connections')) 77 - ->setMessage($message) 78 - ->addMySQLConfig('max_connections'); 79 - } 80 - 81 47 $modes = self::loadRawConfigValue('sql_mode'); 82 48 $modes = explode(',', $modes); 83 49
+7 -1
src/infrastructure/storage/lisk/PhabricatorLiskDAO.php
··· 79 79 // - (T10849) Prevent any query from running for more than 30 seconds. 80 80 // - (T11672) Use persistent connections. 81 81 if (php_sapi_name() != 'cli') { 82 + 83 + // TODO: For now, disable this until after T11044: it's better at high 84 + // load, but causes us to use slightly more connections at low load and 85 + // is pushing users over limits like MySQL "max_connections". 86 + $use_persistent = false; 87 + 82 88 $connection 83 89 ->setQueryTimeout(30) 84 - ->setPersistent(true); 90 + ->setPersistent($use_persistent); 85 91 } 86 92 87 93 return $connection;