Ad Widget

Collapse

zabbix server Can't allocate shared memory for configuration cache Freebsd 1.7.1

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zebr
    Junior Member
    • Dec 2008
    • 5

    #1

    zabbix server Can't allocate shared memory for configuration cache Freebsd 1.7.1

    Hi there.
    I'm trying to install zabbix on my freebsd box
    7.2 - PRERELEASE i386
    Zabbix compiles fine, but when I start zabbix_server I get the following in the zabbix_server.log

    Code:
     97982:20091106:002622.508 End of DBupdate_triggers_after_restart()
     97982:20091106:002622.509 In init_database_cache() size:27978312
     97982:20091106:002622.509 In init_configuration_cache() size:8388608
     97982:20091106:002622.509 Can't allocate shared memory of size 8388608 [Cannot allocate memory]
    And the zabbix_server fails to start.
    Any ideas how to fix it?
    Last edited by zebr; 24-11-2009, 12:20.
  • sersad
    Senior Member
    • May 2009
    • 518

    #2
    You must specify the parameter kernel.shmmax with your desired number of memory. If you want to change kernel.shmmax on running system type
    sysctl -w kernel.shmmax=536870912

    To test
    sysctl -a |grep shmmax

    This is worked on linux

    Comment

    • zebr
      Junior Member
      • Dec 2008
      • 5

      #3
      Setting kern.ip.shmmax to bigger value doesn't solve the problem.

      The same situation is on FreeBSD 6.2-STABLE i386.

      Comment

      • zebr
        Junior Member
        • Dec 2008
        • 5

        #4
        1.7.2 alpha runs the same

        The same stuff is with 1.7.2 alpha.
        The same errors on FreeBSD and still no solution

        Comment

        • bee
          Senior Member
          • Jun 2007
          • 133

          #5
          Any workaround?



          Any workaround to solve this situation?

          Comment

          • emilode
            Junior Member
            Zabbix Certified Specialist
            • Jul 2009
            • 7

            #6
            I ahve the same error

            I have the same error with zabbix 1.8, FreeBSD 7.0. Changing shmax or changing the size in zabbix.conf have not helped.

            error log shows: Can't allocate shared memory of size 67108864 [Invalid argument]
            Can't allocate shared memory for configuration cache

            UPDATE: Problem solved, seems that zabbix_server didn't use the correct zabbix_server.conf file.
            Last edited by emilode; 28-01-2010, 13:09. Reason: Found solution

            Comment

            • bee
              Senior Member
              • Jun 2007
              • 133

              #7
              http://www.zabbix.com/forum/showthread.php?t=14987 works for me,

              Spesific for FreeBSD machine:
              kern.ipc.shmall=2097152
              kern.ipc.shmmax=2147483648
              kern.ipc.shmmni=4096
              kern.ipc.semmsl=250
              kern.ipc.semmns=32000
              kern.ipc.semopm=100
              kern.ipc.semmni=128
              Last edited by bee; 29-01-2010, 08:03. Reason: uncomplete reply.

              Comment


              • kantela
                kantela commented
                Editing a comment
                Thanks for the tip, it solved the problem I was facing.
            • CeeEss
              Senior Member
              Zabbix Certified Specialist
              • Nov 2007
              • 103

              #8
              Originally posted by bee
              http://www.zabbix.com/forum/showthread.php?t=14987 works for me,

              Spesific for FreeBSD machine:
              kern.ipc.shmall=2097152
              kern.ipc.shmmax=2147483648
              kern.ipc.shmmni=4096
              kern.ipc.semmsl=250
              kern.ipc.semmns=32000
              kern.ipc.semopm=100
              kern.ipc.semmni=128
              Had the same issues starting proxy 1.8.2 on OpenBSD and server on CentOS5.4. Doubling shmmax while leaving .conf at defaults solved the problem for proxy and upping CacheSize to 128M worked for server.

              Zabbix, a technote describing shm requirements for server/agentd/proxy and how they relate to default sysctl shm settings would be appreciated! While it seems that most people are finding settings that tentatively get around these problems, i doubt mine (at least) are optimal.

              Comment

              • vanderlanls
                Junior Member
                • Mar 2010
                • 1

                #9
                Solvedhttp://www.zabbix.com/forum/images/smilies/smile.gif

                http://www.zabbix.com/forum/images/smilies/smile.gifHi.

                in my case it was necessary to add the following lines in / etc / sysctl.conf

                kern.ipc.shmall=2097152
                kern.ipc.shmmax=2147483648
                kern.ipc.semmsl=250
                kern.ipc.semopm=100

                and the following lines in / boot / loader.conf

                kern.ipc.semmni=128
                kern.ipc.semmns=32000
                kern.ipc.shmmni=4096

                I restart the Zabbix server and run normally.


                Thanks for the help.

                Vanderlan Lima da Silva http://www.zabbix.com/forum/images/smilies/smile.gif

                Comment

                • CeeEss
                  Senior Member
                  Zabbix Certified Specialist
                  • Nov 2007
                  • 103

                  #10
                  Originally posted by vanderlanls
                  http://www.zabbix.com/forum/images/smilies/smile.gifHi.

                  in my case it was necessary to add the following lines in / etc / sysctl.conf

                  kern.ipc.shmall=2097152
                  kern.ipc.shmmax=2147483648
                  kern.ipc.semmsl=250
                  kern.ipc.semopm=100

                  and the following lines in / boot / loader.conf

                  kern.ipc.semmni=128
                  kern.ipc.semmns=32000
                  kern.ipc.shmmni=4096

                  I restart the Zabbix server and run normally.


                  Thanks for the help.

                  Vanderlan Lima da Silva http://www.zabbix.com/forum/images/smilies/smile.gif
                  And any other kind of voodoo, too. How did you arrive at these settings? This looks like Zabbix server, yes? On CentOS5.4, i had to increase CacheSize to 128M with no changes to shm. It seems that whatever works works when it works, but Zabbix needs to explain its resource requirements more clearly.

                  Comment

                  • umasse
                    Junior Member
                    • Mar 2010
                    • 5

                    #11
                    Same problem in Ubuntu 10.04

                    Ran into this issue with an Ubuntu 10.04 installation, running Zabbix 1.8.1 from the repositories.

                    I had to add this line to "/etc/zabbix/zabbix_server.conf"
                    Code:
                    CacheSize = 64M
                    Then I added a file called "60-zabbixshmem.conf" to the folder "/etc/sysctl.d/"
                    with this in it:
                    Code:
                    # Controls the maximum shared segment size, in bytes
                    kernel.shmmax = 134217728
                    kernel.shmall = 8388608
                    kernel.shmmni = 4096
                    This has made the error go away, Zabbix Server now runs, and is receiving values again.

                    Comment

                    • Andreas Bollhalder
                      Senior Member
                      Zabbix Certified Specialist
                      • Apr 2007
                      • 144

                      #12
                      Howto get the size for shared memory

                      I think, we could get the value needed for the kernel shared memory from the Zabbix doucmentation like this (see http://www.zabbix.com/documentation/...abbix_server):

                      CacheSize 8M
                      HistoryCacheSize 8M
                      HistoryTextCacheSize 16M
                      TrendCacheSize 4M

                      This would give you 36MB. On most Linux system, the default is 32M and therefore too low. In this case of the default values, you should be fine to set "kernel.shmmax" to 64M.

                      If you increase any of the parameters, you have to increase the value for "kernel.shmmax" again. If there is any other service or program which requires shared memory, you must include that into the math too.

                      I assumed, that Zabbix is using 1 shared memory segment for all caches. If it's using one for each cache, then it would look different...

                      Andreas

                      PS: Would be nice, if Zabbix would provide this and more information in server status page.
                      Last edited by Andreas Bollhalder; 08-06-2010, 09:40.
                      Zabbix statistics
                      Total hosts: 380 - Total items: 12190 - Total triggers: 4530 - Required server performance: 224.2

                      Comment

                      • polar773
                        Junior Member
                        • Jan 2011
                        • 1

                        #13
                        Solution!

                        The only variable that was needed to change the kernel ..

                        kern.ipc.shmmax=67108864
                        kern.ipc.shmall=32768

                        can trust..

                        paulogomeskinoshita.blogspot.com

                        Comment

                        • mburns
                          Junior Member
                          • Jan 2011
                          • 2

                          #14
                          still getting this problem with ubuntu 10.04lts

                          Using a mediatemple default DE (512MB, generic linux shell) and am still having this problem.
                          • I've change my kernel shm{all,mni,max} variables (both live, and save to sysctl.conf and rebooting).
                          • clearing the IPC cache with ipcs/ipcrm between each step, too.
                          • set CacheSize to 130M, 64M, 32M, 128K. all with (varying sizes) of memory allocation errors on zabbix_server startup.
                          • not running zabbix-client concurrently, for testing.



                          System: Ubuntu 10.04 LTS. Postgres8.4. Zabbix 1.8.2 (apt-get) and now I've compiled Zabbix 1.9 from source.

                          Code:
                          Cannot allocate shared memory of size 111412 [No space left on device]
                          Could not allocate shared memory for configuration cache.
                          Is there a way to see how much free shared memory (in this context) is available. Presumably postgres is taking all of it up. Though *actual* memory allocation is far from full (350+M free).

                          I've tried set shm{mni,max,all} to really, really large values, just to see. Nothing.

                          Why my zabbix-server no happy?

                          Comment

                          • cherish2004
                            Junior Member
                            • Apr 2014
                            • 7

                            #15
                            Me too

                            Code:
                            23866:20140422:190736.554 using configuration file: /zabbix/zabbix/etc/zabbix_server.conf
                             23866:20140422:190736.555 cannot attach shared memory for configuration cache: [12] Cannot allocate memory
                            My zabbix version is 2.2.3, and I install it on my linux vm, memory is 2G.
                            Any idear?
                            3Q!

                            Comment

                            Working...