Page MenuHomePhabricator

Add a setup issue about small "max_connections" settings
ClosedPublic

Authored by epriestley on Sep 22 2016, 7:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Mar 26, 9:58 AM
Unknown Object (File)
Sun, Mar 24, 8:41 AM
Unknown Object (File)
Sat, Mar 9, 1:37 PM
Unknown Object (File)
Thu, Feb 29, 1:16 AM
Unknown Object (File)
Feb 2 2024, 7:28 PM
Unknown Object (File)
Feb 2 2024, 9:14 AM
Unknown Object (File)
Jan 1 2024, 3:57 AM
Unknown Object (File)
Dec 26 2023, 5:59 AM
Subscribers
None

Details

Summary

Fixes T11683. Likely as a result of the persitent connections change, more users are seeing MySQL connection limit errors.

The persistent connections change means we use fewer connections at the high end, but I'm guessing PHP is keeping some more connections around in the pool, so while high-traffic hosts use fewer connections, low-traffic hosts now use more.

Raise an explicit setup warning about this. Users should be adjusting it anyway, there's no value to leaving it at extremely low default and connections are baiscally free until you run out of outbound ports.

Test Plan

Screen Shot 2016-09-22 at 12.32.10 PM.png (1×1 px, 253 KB)

Diff Detail

Repository
rP Phabricator
Branch
mysql1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 13812
Build 17851: Run Core Tests
Build 17850: arc lint + arc unit

Event Timeline

epriestley retitled this revision from to Add a setup issue about small "max_connections" settings.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
src/applications/config/check/PhabricatorMySQLSetupCheck.php
66

is this number right?

Yeah, my reasoning is:

  • I know of no reason to have this limit at all.
  • We can't disable it: the minimum value is 1 and the maximum value is 100000.
  • Picking 32768 (half of the number of outbound TCP ports, 65536) is largely arbitrary, but means that the host won't exhaust outbound ports if it's connecting to itself over TCP for some reason (unusual, but not unheard of), probably.
src/applications/config/check/PhabricatorMySQLSetupCheck.php
50

Oh I forgot some words here, one sec.

chad edited edge metadata.
This revision is now accepted and ready to land.Sep 22 2016, 7:48 PM

There seems to be a very weak argument for setting this to "memory on your host - innodb buffer size - some other buffers / approximate memory usage of a connection" so that MySQL will start rejecting connections rather than swapping to death if you exhaust all the memory on the host.

I still think "a million billion" is the right value for 99% of installs, but I'll be slightly more nuanced in discussing how to select a value.

epriestley edited edge metadata.
  • Fill in missing words.
  • Offer users the chance to do a lot of math if they're really committed.
This revision was automatically updated to reflect the committed changes.