Skip to content

Manage VsphereDB php memory limit in config.ini #600

@TribalTux

Description

@TribalTux

We have an issue with the memory limit due to a large Vcenter infrastructure. The service fail with this error :

Dec 02 11:57:02 myserver icingacli[2765026]: PHP Fatal error:  Allowed memory size of 1073741824 bytes exhausted (tried to allocate 24193560 bytes) in /usr/share/icinga-php/vendor/vendor/react>
Dec 02 11:57:02 myserver icingacli[2765026]: Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 24193560 bytes) in /usr/share/icinga-php/vendor/vendor/react/stre>
Dec 02 11:57:02 myserver systemd[1]: icinga-vspheredb.service: Main process exited, code=exited, status=255/EXCEPTION
Dec 02 11:57:02 myserver systemd[1]: icinga-vspheredb.service: Failed with result 'exit-code'.

To fix the service restart loop, we have temporarily patched it as follows:

diff --git a/library/Vspheredb/Daemon/VsphereDbDaemon.php b/library/Vspheredb/Daemon/VsphereDbDaemon.php
index ac6df8b..25eaaf7 100644
--- a/library/Vspheredb/Daemon/VsphereDbDaemon.php
+++ b/library/Vspheredb/Daemon/VsphereDbDaemon.php
@@ -114,7 +114,7 @@ class VsphereDbDaemon implements DaemonTask, SystemdAwareTask, LoggerAwareInterf
 
     public function start(LoopInterface $loop)
     {
-        MemoryLimit::raiseTo('1024M');
+        MemoryLimit::raiseTo('2048M');
         $this->loop = $loop;
         $logger = $this->logger;
         $this->daemonState = $this->initializeDaemonState();

The idea would be to be able to start the service with a specific configuration in the file /etc/icingaweb2/modules/vspheredb/config.ini

[php]
memory_limit = “2048”

Thanks,

Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions