IcingaConfig: workaround for GC issues...

...affecting RHEL/CentOS 7

fixes #12063
This commit is contained in:
Thomas Gelf 2016-06-30 12:17:32 +02:00
parent 6178ca8320
commit cf424aa8ba
1 changed files with 8 additions and 1 deletions

View File

@ -372,8 +372,13 @@ class IcingaConfig
$start = microtime(true); $start = microtime(true);
// Raise limits. TODO: do this in a failsafe way, and only if necessary // 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); 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\'') { if (! $this->connection->isPgsql() && $this->db->quote("1\0") !== '\'1\\0\'') {
@ -402,6 +407,8 @@ class IcingaConfig
->prepend("library \"methods\"\n\n"); ->prepend("library \"methods\"\n\n");
PrefetchCache::forget(); PrefetchCache::forget();
IcingaHost::clearAllPrefetchCaches();
$this->generationTime = (int) ((microtime(true) - $start) * 1000); $this->generationTime = (int) ((microtime(true) - $start) * 1000);
return $this; return $this;