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)
Wed, Dec 18, 9:02 PM
Unknown Object (File)
Fri, Dec 13, 10:24 PM
Unknown Object (File)
Mon, Dec 9, 5:49 AM
Unknown Object (File)
Sat, Dec 7, 1:31 PM
Unknown Object (File)
Fri, Dec 6, 3:50 PM
Unknown Object (File)
Fri, Dec 6, 2:58 AM
Unknown Object (File)
Wed, Dec 4, 11:53 PM
Unknown Object (File)
Sun, Dec 1, 5:30 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 13811
Build 17849: Run Core Tests
Build 17848: 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.