@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.

Add a setup warning about innodb_buffer_pool_size

Summary: Fixes T6119. This is a little fuzzy, but generally bumping up `innodb_buffer_pool_size` to something bigger than the default (which is often anemic, at `8M`) is desriable, and it seems like it will fix the specific issue a user encountered in T6119.

Test Plan: {F211855}

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T6119

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

+49
+49
src/applications/config/check/PhabricatorSetupCheckMySQL.php
··· 186 186 } 187 187 } 188 188 189 + $innodb_pool = self::loadRawConfigValue('innodb_buffer_pool_size'); 190 + $innodb_bytes = phutil_parse_bytes($innodb_pool); 191 + $innodb_readable = phutil_format_bytes($innodb_bytes); 192 + 193 + // This is arbitrary and just trying to detect values that the user 194 + // probably didn't set themselves. The Mac OS X default is 128MB and 195 + // 40% of an AWS EC2 Micro instance is 245MB, so keeping it somewhere 196 + // between those two values seems like a reasonable approximation. 197 + $minimum_readable = '225MB'; 198 + 199 + $minimum_bytes = phutil_parse_bytes($minimum_readable); 200 + if ($innodb_bytes < $minimum_bytes) { 201 + $summary = pht( 202 + 'MySQL is configured with a very small innodb_buffer_pool_size, '. 203 + 'which may impact performance.'); 204 + 205 + $message = pht( 206 + "Your MySQL instance is configured with a very small %s (%s). ". 207 + "This may cause poor database performance and lock exhaustion.\n\n". 208 + "There are no hard-and-fast rules to setting an appropriate value, ". 209 + "but a reasonable starting point for a standard install is something ". 210 + "like 40%% of the total memory on the machine. For example, if you ". 211 + "have 4GB of RAM on the machine you have installed Phabricator on, ". 212 + "you might set this value to %s.\n\n". 213 + "You can read more about this option in the MySQL documentation to ". 214 + "help you make a decision about how to configure it for your use ". 215 + "case. There are no concerns specific to Phabricator which make it ". 216 + "different from normal workloads with respect to this setting.\n\n". 217 + "To adjust the setting, add something like this to your %s file (in ". 218 + "the %s section), replacing %s with an appropriate value for your ". 219 + "host and use case. Then restart %s:\n\n". 220 + "%s\n". 221 + "If you're satisfied with the current setting, you can safely ". 222 + "ignore this setup warning.", 223 + phutil_tag('tt', array(), 'innodb_buffer_pool_size'), 224 + phutil_tag('tt', array(), $innodb_readable), 225 + phutil_tag('tt', array(), '1600M'), 226 + phutil_tag('tt', array(), 'my.cnf'), 227 + phutil_tag('tt', array(), '[mysqld]'), 228 + phutil_tag('tt', array(), '1600M'), 229 + phutil_tag('tt', array(), 'mysqld'), 230 + phutil_tag('pre', array(), 'innodb_buffer_pool_size=1600M')); 231 + 232 + $this->newIssue('mysql.innodb_buffer_pool_size') 233 + ->setName(pht('MySQL May Run Slowly')) 234 + ->setSummary($summary) 235 + ->setMessage($message) 236 + ->addMySQLConfig('innodb_buffer_pool_size'); 237 + } 189 238 190 239 } 191 240