From: Alexander Ebert Date: Wed, 6 Jun 2012 16:31:32 +0000 (+0200) Subject: Added health check for innodb_flush_log_at_trx_commit X-Git-Tag: 2.0.0_Beta_1~1077 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7da10d828929dd101b3c78743930f877d2ed8d04;p=GitHub%2FWoltLab%2FWCF.git Added health check for innodb_flush_log_at_trx_commit --- 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) {