Ad Widget

Collapse

zbx_mem_malloc(): out of memory

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • turboaaa2
    Junior Member
    • Nov 2018
    • 4

    #1

    zbx_mem_malloc(): out of memory

    I am migrating to the docker instance of Zabbix. It is able to connect to the database, but shortly crashes with the following error. I tried adding "CacheSize=2G" to a copy of the config file, then copying it into the container

    docker cp zabbix_server.conf zabbix-server:/etc/zabbix/zabbix_server.conf

    But after starting I would receive the same error message


    ** Starting Zabbix server
    Starting Zabbix Server. Zabbix 4.0.1 (revision 86073).
    Press Ctrl+C to exit.

    1:20181106:142220.364 Starting Zabbix Server. Zabbix 4.0.1 (revision 86073).
    1:20181106:142220.364 ****** Enabled features ******
    1:20181106:142220.364 SNMP monitoring: YES
    1:20181106:142220.364 IPMI monitoring: YES
    1:20181106:142220.364 Web monitoring: YES
    1:20181106:142220.364 VMware monitoring: YES
    1:20181106:142220.364 SMTP authentication: YES
    1:20181106:142220.364 Jabber notifications: NO
    1:20181106:142220.364 Ez Texting notifications: YES
    1:20181106:142220.364 ODBC: YES
    1:20181106:142220.364 SSH2 support: YES
    1:20181106:142220.364 IPv6 support: YES
    1:20181106:142220.364 TLS support: YES
    1:20181106:142220.364 ******************************
    1:20181106:142220.364 using configuration file: /etc/zabbix/zabbix_server.conf
    1:20181106:142221.132 current database version (mandatory/optional): 04000000/04000000
    1:20181106:142221.132 required mandatory version: 04000000
    1:20181106:142225.148 __mem_malloc: skipped 14 asked 244072 skip_min 264 skip_max 218840
    1:20181106:142225.155 __mem_malloc: skipped 0 asked 136 skip_min 18446744073709551615 skip_max 0
    1:20181106:142225.155 [file:dbconfig.c,line:94] zbx_mem_malloc(): out of memory (requested 136 bytes)
    1:20181106:142225.155 [file:dbconfig.c,line:94] zbx_mem_malloc(): please increase CacheSize configuration parameter
    1:20181106:142225.155 === memory statistics for configuration cache ===
    1:20181106:142225.155 free chunks of size 24 bytes: 90
    1:20181106:142225.155 free chunks of size 32 bytes: 3
    1:20181106:142225.155 min chunk size: 24 bytes
    1:20181106:142225.155 max chunk size: 32 bytes
    1:20181106:142225.155 memory of total size 8388232 bytes fragmented into 74864 chunks
    1:20181106:142225.155 of those, 2256 bytes are in 93 free chunks
    1:20181106:142225.155 of those, 7188168 bytes are in 74771 used chunks
    1:20181106:142225.155 ================================
    1:20181106:142225.155 backtrace is not available for this platform
  • kloczek
    Senior Member
    • Jun 2006
    • 1771

    #2
    please increase CacheSize configuration parameter
    http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
    https://kloczek.wordpress.com/
    zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
    My zabbix templates https://github.com/kloczek/zabbix-templates

    Comment

    • turboaaa2
      Junior Member
      • Nov 2018
      • 4

      #3
      That's what I thought I did by adding

      CacheSize=2G

      to the server config file. Am I using the wrong format? What value would you recommend? I was giving it a large amount for troubleshooting.

      Comment

      • kloczek
        Senior Member
        • Jun 2006
        • 1771

        #4
        Originally posted by turboaaa2
        That's what I thought I did by adding

        CacheSize=2G

        to the server config file. Am I using the wrong format? What value would you recommend? I was giving it a large amount for troubleshooting.
        I don't remember what was the exact unit G or GB .. just try (ATM I have no access to any zabbix).
        CacheSize memory is for to keep all items and triggers configuration in memory.of the server/proxy processes. More items and more triggers you have than more memory for the CacheSize needs to be specified.
        You should have monitoring of the zabbix server and proxies. I don't remember how it is in standard zabbix templates because I'm using mine but in mine templates I'm monitoring over internal zabbix metrics configured CacheSize and actual used space of this cache. On top of this is defined trigger raising alarm that used space is close to CacheSize. This allows to reconfigure srv/proxy in advance instead be surprised that suddenly svr/prx process died.
        http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
        https://kloczek.wordpress.com/
        zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
        My zabbix templates https://github.com/kloczek/zabbix-templates

        Comment

        • turboaaa2
          Junior Member
          • Nov 2018
          • 4

          #5
          I did have the correct format, but the copy is not working as expected. Checking the container files I was unable to find my edits.

          [ michaelws Fri Nov 09 zabbix ] $ sudo find /var/lib/docker/overlay2/f706c33e4ed11f859bb913a10183595b0803ca563dd8bc1694 5c03d51fdd4d65/ -name zabbix_server.conf -exec grep CacheSize {} \;
          ### Option: VMwareCacheSize
          # VMwareCacheSize=8M
          ### Option: CacheSize
          ### Option: HistoryCacheSize
          # HistoryCacheSize=16M
          ### Option: HistoryIndexCacheSize
          ### Option: TrendCacheSize
          # TrendCacheSize=4M
          ### Option: ValueCacheSize


          Compared to the conf file that I thought I copied into the container

          [ michaelws Fri Nov 09 zabbix ] $ sudo grep CacheSize zabbix_server.conf
          ### Option: VMwareCacheSize
          # VMwareCacheSize=8M
          ### Option: CacheSize
          CacheSize=2G
          ### Option: HistoryCacheSize
          # HistoryCacheSize=16M
          ### Option: HistoryIndexCacheSize
          HistoryIndexCacheSize=512M
          ### Option: TrendCacheSize
          # TrendCacheSize=4M
          ### Option: ValueCacheSize
          ValueCacheSize=400M


          Looking closer at the logs reveals that the docker startup routine is wiping out the config

          ** Preparing Zabbix server configuration file
          ...
          ** Updating '/etc/zabbix/zabbix_server.conf' parameter "CacheSize": ''... removed
          ...

          Comment

          • turboaaa2
            Junior Member
            • Nov 2018
            • 4

            #6
            I was able to get the server started by binding the file stored on the host to the container as read only. Not ideal nor as portable as I would like.

            Does anyone know of an environmental variable that I am missing?

            sudo docker run --name zabbix-server -v /home/michael.mast/build/zabbix/zabbix_server.conf:/etc/zabbix/zabbix_server.conf:ro -t -e DB_SERVER_HOST='zabbix.cluster-<..>.us-east-2.rds.amazonaws.com' -e MYSQL_USER='zabbix' -e MYSQL_PASSWORD='password' -e TZ='America/NewYork' -p 10051:10051 -d zabbix/zabbix-server-mysql:latest

            Comment

            • Turboaaa2018
              Junior Member
              • May 2018
              • 5

              #7
              Here is the answer https://hub.docker.com/r/zabbix/zabbix-server-mysql/

              The Zabbix manual does not include all the environmental variables, had to look them up on the docker hub. The setting I was looking for is
              ZBX_CACHESIZE=2G

              ------
              Just realized I have two accounts on the forum. Will need to consolidate these lol

              Comment

              Working...