From 7da10d828929dd101b3c78743930f877d2ed8d04 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 6 Jun 2012 18:31:32 +0200 Subject: [PATCH] Added health check for innodb_flush_log_at_trx_commit --- .../install/files/lib/acp/page/IndexPage.class.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/wcfsetup/install/files/lib/acp/page/IndexPage.class.php b/wcfsetup/install/files/lib/acp/page/IndexPage.class.php index 9747d86362..60761bd5fa 100755 --- a/wcfsetup/install/files/lib/acp/page/IndexPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/IndexPage.class.php @@ -61,6 +61,17 @@ class IndexPage extends AbstractPage { */ public function calculateHealth() { try { + // InnoDB's innodb_flush_log_at_trx_commit=1 causes poor performance, 2 is a better choice + if (get_class(WCF::getDB()) == 'wcf\system\database\MySQLDatabase') { + $sql = "SHOW VARIABLES LIKE ?"; + $statement = WCF::getDB()->prepareStatement($sql); + $statement->execute(array('innodb_flush_log_at_trx_commit')); + $row = $statement->fetchArray(); + if ($row['Value'] == '1') { + $this->healthDetails['warning'][] = WCF::getLanguage()->get('wcf.acp.index.health.innodbFlushLog'); + } + } + // TODO: Fill this list $shouldBeWritable = array(WCF_DIR); foreach ($shouldBeWritable as $file) { -- 2.20.1