Skip to content

Commit 7848263

Browse files
committed
Always show MySQL variables, also if check is ok
This helps quickly inspecting settings, in my case for example the MySQL transaction isolation level. We should probably do this for all configuration settings.
1 parent 2d6f4ff commit 7848263

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

webapp/src/Service/CheckConfigService.php

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,27 +222,35 @@ public function checkMysqlSettings(): ConfigCheckItem
222222
$desc = '';
223223
if ($vars['max_connections'] < 300) {
224224
$result = 'W';
225-
$desc .= sprintf("MySQL's max_connections is set to %s. In our experience you need at least 300, but better 1000 connections to prevent connection refusal during the contest.\n", $vars['max_connections']);
225+
$desc .= sprintf("max_connections is set to %s. In our experience you need at least 300, but better 1000 connections to prevent connection refusal during the contest.\n", $vars['max_connections']);
226+
} else {
227+
$desc .= sprintf("max_connections is set to %s.\n", $vars['max_connections']);
226228
}
227229

228230
if ($vars['innodb_log_file_size'] < 10 * $max_inout) {
229231
$result = 'W';
230-
$desc .= sprintf("MySQL's innodb_log_file_size is set to %s. You may want to raise this to 10x the maximum of the test case size and output (storage) limit (now %s).\n", Utils::printsize((int)$vars['innodb_log_file_size']), Utils::printsize($max_inout));
232+
$desc .= sprintf("innodb_log_file_size is set to %s. You may want to raise this to 10x the maximum of the test case size and output (storage) limit (now %s).\n", Utils::printsize((int)$vars['innodb_log_file_size']), Utils::printsize($max_inout));
233+
} else {
234+
$desc .= sprintf("innodb_log_file_size is set to %s. \n", Utils::printsize((int)$vars['innodb_log_file_size']));
231235
}
232236

233237
$tx = ['REPEATABLE-READ', 'SERIALIZABLE'];
234238
if (!in_array($vars['tx_isolation'], $tx)) {
235239
$result = 'W';
236-
$desc .= sprintf("MySQL's transaction isolation level is set to %s. You should set this to %s to prevent data inconsistencies.\n", $vars['tx_isolation'], implode(' or ', $tx));
240+
$desc .= sprintf("transaction isolation level is set to %s. You should set this to %s to prevent data inconsistencies.\n", $vars['tx_isolation'], implode(' or ', $tx));
241+
} else {
242+
$desc .= sprintf("transaction isolation level is set to %s.\n", $vars['tx_isolation']);
237243
}
238244

239245
$recommended_max_allowed_packet = 16*1024*1024;
240246
if ($vars['max_allowed_packet'] < 2*$max_inout) {
241247
$result = 'E';
242-
$desc .= sprintf("MySQL's max_allowed_packet is set to %s. You may want to raise this to about twice the maximum of the test case size and output (storage) limit (currently %s).\n", Utils::printsize((int)$vars['max_allowed_packet']), Utils::printsize($max_inout));
248+
$desc .= sprintf("max_allowed_packet is set to %s. You may want to raise this to about twice the maximum of the test case size and output (storage) limit (currently %s).\n", Utils::printsize((int)$vars['max_allowed_packet']), Utils::printsize($max_inout));
243249
} elseif ($vars['max_allowed_packet'] < $recommended_max_allowed_packet) {
244250
$result = 'W';
245-
$desc .= sprintf("MySQL's max_allowed_packet is set to %s. We recommend at least 16MB.\n", Utils::printsize((int)$vars['max_allowed_packet']));
251+
$desc .= sprintf("max_allowed_packet is set to %s. We recommend at least 16MB.\n", Utils::printsize((int)$vars['max_allowed_packet']));
252+
} else {
253+
$desc .= sprintf("max_allowed_packet is set to %s.\n", Utils::printsize((int)$vars['max_allowed_packet']));
246254
}
247255

248256
$this->stopwatch->stop(__FUNCTION__);

0 commit comments

Comments
 (0)