Welcome to Pandora FMS Community!

Find answers, ask questions, and connect with our community around the world.

  • Memory Usage / Leak

    Posted by Christophe on marzo 2, 2022 at 17:31

    Hello,

    I’ve got a Community Pandora version, and I manage since now 3 months a lot of devices. Everything works fine, but when I look at the Memory usage, it’s growing, and my free memory is less and less. Even by restarting the server, I’m never been able to obtain back a normal Value.

    Do you know if there is a “memory leak” in the system, as every 2 month, I must add “memory to my server”….

    Thanks for your help

    Christophe M.

    Christophe replied 2 years, 10 months ago 4 Members · 18 Replies
  • 18 Replies
  • vic

    Administrator
    marzo 2, 2022 at 18:29
    1547 Karma points
    Community awards: bulb Bright ideas
    Community rank: tentacle_master_icon Tentacle Master
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hi Christophe,

    Can you find out which process is consuming RAM memory non-stop?

    You can use the TOP command and attach a screenshot.

    Once we know which process is causing the problem, we can perform the necessary actions.

    Best regards,

    Víctor.

  • Sancho

    Administrator
    marzo 2, 2022 at 20:27
    2229 Karma points
    Community awards: bulb Bright ideas
    Community rank: tentacle_master_icon Tentacle Master
    Like it
    Up
    0
    Down
    Drop it
    ::

    The leak is on the Pandora FMS server or in another component? (windows agent, MacOS agent) ?

  • Christophe

    Member
    marzo 3, 2022 at 08:51
    324 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hello,

    It’s the Pandora Server.

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

    1574 root 20 0 376220 19104 5088 S 2.7 0.2 631:05.35 php

    1712 root 20 0 4289172 1.5g 5756 S 2.3 20.9 1256:16 pandora_server

    984 cwagent 20 0 770744 30732 5012 S 0.3 0.4 50:34.53 amazon-cloudwat

    1482 mysql 20 0 4963180 2.6g 8864 S 0.3 36.2 1741:41 mysqld

    4777 root 20 0 162104 2292 1592 R 0.3 0.0 0:00.05 top

    1 root 20 0 43692 3616 2136 S 0.0 0.0 1:56.22 systemd

    2 root 20 0 0 0 0 S 0.0 0.0 0:00.11 kthreadd PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    1574 root 20 0 376220 19104 5088 S 2.7 0.2 631:05.35 php
    1712 root 20 0 4289172 1.5g 5756 S 2.3 20.9 1256:16 pandora_server
    984 cwagent 20 0 770744 30732 5012 S 0.3 0.4 50:34.53 amazon-cloudwat
    1482 mysql 20 0 4963180 2.6g 8864 S 0.3 36.2 1741:41 mysqld
    4777 root 20 0 162104 2292 1592 R 0.3 0.0 0:00.05 top
    1 root 20 0 43692 3616 2136 S 0.0 0.0 1:56.22 systemd
    2 root 20 0 0 0 0 S 0.0 0.0 0:00.11 kthreadd

    Here is the result, main part are used by the Pandora and MySQL database…

    Thanks for help

    • Sancho

      Administrator
      marzo 5, 2022 at 19:47
      2229 Karma points
      Community awards: bulb Bright ideas
      Community rank: tentacle_master_icon Tentacle Master
      Like it
      Up
      0
      Down
      Drop it
      ::

      Wow.

      Thats a lot. Could you please put here the .conf of the server and the exact version of the server? (for example 7.0NG OUM 756), and the OS version (for example: Centos 7.3)

  • Christophe

    Member
    marzo 7, 2022 at 09:47
    324 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    hello,

    My version : Pandora FMS v7.0NG.759 – OUM 759 – MR 51

    Work on Centos 7.3

    Regards

  • Christophe

    Member
    marzo 7, 2022 at 09:48
    324 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    How can I put my .conf file ? (if I copy it, it’s too large, how can I put file or image on this forum ?)

  • Mario

    Administrator
    marzo 7, 2022 at 11:54
    1150 Karma points
    Community rank: tentacle_master_icon Tentacle Master
  • Mario

    Administrator
    marzo 7, 2022 at 12:08
    1150 Karma points
    Community rank: tentacle_master_icon Tentacle Master
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hi Christophe.

    Threads and configuration in pandora_server.conf seems correct for a lightly loaded environment. Seeing that the memory usage is high in the mysql server and the Pandora FMS server, it seems that both processes are having problems when processing all the information.

    Could you tell us the following information?

    – Days stored in the database data, events and traps.

    – Current size of the tables tagente_datos, tagente_datos_string, ttrap and tevento.

    – Mysql optimization ( send us /etc/my.cnf ). It should contain a setting similar to this one:

    https://pandorafms.com/manual/en/documentation/05_big_environments/08_optimization#mycnf

    Thanks

  • Christophe

    Member
    marzo 7, 2022 at 12:19
    324 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hello

    I keep 45 days of data. The current size of my tables :

    6826687 t_agente_datos

    521323 t_agente_datos_string

    1060389 ttrap

    1065938 tevento

    and link my my.cnf file.

    Thanks for help

    Christophe

  • Mario

    Administrator
    marzo 7, 2022 at 13:46
    1150 Karma points
    Community rank: tentacle_master_icon Tentacle Master
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hi Christophe.

    Seeing the data that you have stored and the time that you have been running the environment, it is possible that the database is fragmented and for that reason there may be a degradation in the reading and writing with the database.

    Anyway, if you do not have problems of unknowns and queuing in the servers, it is possible that you do not have problems with the current data stored in database. As you have the community version you cannot install a second historical database reducing the data in the main one to 15 days to make it work faster and sending the rest of the data to the historical one, being able to store in it up to years. https://pandorafms.com/manual/en/documentation/05_big_environments/07_server_management?s%5B%5D=historical&s%5B%5D=database#history_database

    A question, do you have monitored the exact memory consumption of the pandora_server process? Do you notice an increase in it inside the ps aux command? It would be nice to see how the graph of this module looks like…

    module_begin

    module_name Pandora Server memory

    module_type generic_data

    module_exec ps aux | grep pandora_server | grep “D” | gawk ‘{print $4}’

    module_end

    In the case that it is the free memory that is decreasing in the server and the available memory is kept because it starts to pass to buffer/cache memory, it is a normal behavior of the server due to the memory management of the linux systems,

    Some time ago a memory leak was discovered in openssl / curl libraries. I have seen that you have enabled the webserver, do you have active web monitoring to URL with https? In the Enterprise version it is compiled into the binary and stopped happening ( webserver recently only was Enterprise), but it is possible that the openssl, curl and perl-Net-SSLeay versions may cause extra memory consumption.

    You can try to uncomment the following line ( web_engine lwp ) in the pandora_server.conf to use LWP instead of curl in case you have monitoring of this type added and it can cause to these libraries.

    Regards

  • Christophe

    Member
    marzo 7, 2022 at 14:14
    324 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hello,

    Yes, I’m in community and can’t save in the history.

    The problem is more that the system is running from ore than 45 days, and the available memory is going down, and down. We have to add memory and restart the server (hosted in AWS) to get some space freed.

    I’ve put the images of the memory usage (free memory and percentage of usage).

    I don’t use the HTTPs verification, only SNMP messages and Cloudwatch plugin.

    I see that during last days, there is a stabilisation… perhaps I’ve reached the time of purge of the 45 days (?)

    Regards

    Christophe

  • Mario

    Administrator
    marzo 7, 2022 at 14:40
    1150 Karma points
    Community rank: tentacle_master_icon Tentacle Master
    Like it
    Up
    0
    Down
    Drop it
    ::

    Could you send us the output of the free command at this moment?

  • Christophe

    Member
    marzo 7, 2022 at 14:51
    324 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
  • Mario

    Administrator
    marzo 7, 2022 at 15:02
    1150 Karma points
    Community rank: tentacle_master_icon Tentacle Master
    Like it
    Up
    0
    Down
    Drop it
    ::

    Ok, try to leave the server for a few days without restarting the server process to see if the memory is still. Actually the important is the available memory and that should not go down in case you do not add new monitoring or run heavier tasks in the next days…
    It is possible as you say that you have reached the maximum of stored data and there is no further degradation in the system.

  • Christophe

    Member
    marzo 7, 2022 at 15:04
    324 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hello,

    Will try to check next Monday 😀

    Regard

    Christophe

  • Christophe

    Member
    marzo 17, 2022 at 19:58
    324 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hello,

    I will do an update on Monday…

    Thanks for your support.

    Christophe

  • Christophe

    Member
    marzo 17, 2022 at 20:02
    324 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Just a quick look, but it looks like very much better, as the top value has been reached now, and it’s stabilized since few days now…

    Thanks