Skip to content

Commit

Permalink
IcingaConfig: workaround for GC issues...
Browse files Browse the repository at this point in the history
...affecting RHEL/CentOS 7

fixes #12063
  • Loading branch information
Thomas-Gelf committed Jun 30, 2016
1 parent 6178ca8 commit cf424aa
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion library/Director/IcingaConfig/IcingaConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,13 @@ protected function generateFromDb()
$start = microtime(true);

// Raise limits. TODO: do this in a failsafe way, and only if necessary
ini_set('memory_limit', '768M');
if ((string) ini_get('memory_limit') !== '-1') {
ini_set('memory_limit', '1024M');
}

ini_set('max_execution_time', 0);
// Workaround for https://bugs.php.net/bug.php?id=68606 or similar
ini_set('zend.enable_gc', 0);

if (! $this->connection->isPgsql() && $this->db->quote("1\0") !== '\'1\\0\'') {

Expand Down Expand Up @@ -402,6 +407,8 @@ protected function generateFromDb()
->prepend("library \"methods\"\n\n");

PrefetchCache::forget();
IcingaHost::clearAllPrefetchCaches();

$this->generationTime = (int) ((microtime(true) - $start) * 1000);

return $this;
Expand Down

0 comments on commit cf424aa

Please sign in to comment.