Ad Widget

Collapse

memory leak in zabbix proxy 1.6.1

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tekknokrat
    Senior Member
    • Sep 2008
    • 140

    #16
    I am using zabbix in a productional and lab-environment.
    The issue with eating mem. is only happening in the production environment. The lab-environment is virtual. In the production environment the only difference is that I have also added UserParameter checks (beneath others) for reading hd/cpu temperature:

    UserParameter=up.system.cpu.comm[*],ps S -C $1 -o pcpu= --sort=-pcpu | head -1
    UserParameter=up.sensor[*],sensors|sed -n '/$1/p'|sed 's/$1: *+\([0-9]\{1,3\}\.[0-9]\{1,3\}\).*/\1/'

    Comment

    • bbrendon
      Senior Member
      • Sep 2005
      • 870

      #17
      Originally posted by Alexei
      Well, the memory leak is not identified yet. What item type do you use on the proxies? Passive, active, SNMP, anything else?
      For the server, I don't use SNMP. Most of the agents are active and most are v1.4.6. I also use web monitoring.

      Libs I use: libcurl-gnutls.so.3, libmysqlclient.so.15.

      Zabbix 1.6.1 is 100% reliable for me. No memory leaks that I have seen.
      Unofficial Zabbix Expert
      Blog, Corporate Site

      Comment

      • elvar
        Senior Member
        • Feb 2008
        • 226

        #18
        Originally posted by bbrendon
        For the server, I don't use SNMP. Most of the agents are active and most are v1.4.6. I also use web monitoring.

        Libs I use: libcurl-gnutls.so.3, libmysqlclient.so.15.

        Zabbix 1.6.1 is 100% reliable for me. No memory leaks that I have seen.

        I'm betting it's SNMP even more than that is the leak issue.

        Comment

        • Alexei
          Founder, CEO
          Zabbix Certified Trainer
          Zabbix Certified SpecialistZabbix Certified Professional
          • Sep 2004
          • 5654

          #19
          We did more testing and one round of partial code review. We found one memory leak related to handling of external checks only. I do not think external checks are used frequently.

          It does look like a memory leak in net-snmp libs to me so far.
          Alexei Vladishev
          Creator of Zabbix, Product manager
          New York | Tokyo | Riga
          My Twitter

          Comment

          • teferi
            Member
            • Jul 2008
            • 93

            #20
            Originally posted by elvar
            I'm not sure if I am having this or not, but my Zabbix server at a colo is currently unreachable and I just recently upgraded to 1.6.1. Just before becoming unreachable I received Zabbix alerts saying that the swap file was used up.

            This is not server's issue. We're discussing zabbix_proxy here

            Comment

            • cioris
              Member
              • Oct 2008
              • 30

              #21
              still having problems...

              Hi all,

              Sorry for no posting in the last period, but I was in a short vacation...uuhhhh.. it's good to rest from time to time...

              I was very surprized to see how many other postiongs appeared meanwhile. Initialy I was alone, so I was thinking I was doing something wrong. Good to see there are some others in my situation... at least I know I'm not stupid....

              My proxy is used just for active checks, and all clients connected to proxy are windows machines. Here is the list of monitored parameters (I hope it helps):

              - Automatic Update Service - service_state[wuauserv]
              - Free disk space on c: - vfs.fs.size[c:,free]
              - host Information - system.uname
              - Host uptime - system.uptime
              - Physical free memory - vm.memory.size[free]
              - Free physical memory % - vm.memory.size[pfree]
              - Total physical memory - vm.memory.size[total]
              - Ping to Server - agent.ping
              - Processor load - system.cpu.util[]
              - DHCP client - service_state[Dhcp]
              - Terminal Service - service_state[TermService]
              - Total disk space on c: - vfs.fs.size[c:,total]
              - Processor load 2 - perf_counter[\Processor(_Total)\% Processor Time]
              - used space on c: - vfs.fs.size[c:,used]
              - agent version - agent.version
              - free swap - system.swap.size[,free]
              - free swap % - system.swap.size[,pfree]
              - Total swap - system.swap.size[,total]
              - Vnc Service - service_state[winvnc]

              Again, all are active checks. Please let me know if you see anything wrong w/ one or more parameter causing the proxy to fail.

              As a temporary solution I used crond to restart the proxy every 24h. Otherwise it crashes after 4-5 days (after it eats all memory and swap).

              BR

              Comment

              • k-ren
                Junior Member
                • Oct 2008
                • 12

                #22
                I met the same problem on proxy

                Comment

                • cioris
                  Member
                  • Oct 2008
                  • 30

                  #23
                  any news? somebody working on this problem?

                  Comment

                  • k-ren
                    Junior Member
                    • Oct 2008
                    • 12

                    #24
                    I am using zabbix1.6.1 on Redhat Enterprise5.
                    The memory leak will happen just like this.

                    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
                    6383 zabbix 20 5 11284 2760 1728 S 2 0.5 0:37.52 zabbix_proxy
                    6384 zabbix 20 5 11284 2760 1728 S 2 0.5 0:37.44 zabbix_proxy
                    6385 zabbix 20 5 11284 2760 1728 S 2 0.5 0:36.84 zabbix_proxy
                    6386 zabbix 20 5 11284 2764 1732 S 2 0.5 0:37.60 zabbix_proxy
                    6378 zabbix 20 5 7988 1644 984 S 0 0.3 0:01.71 zabbix_proxy
                    6376 zabbix 23 5 7748 824 524 S 0 0.2 0:00.01 zabbix_proxy
                    6377 zabbix 20 5 17968 11m 976 S 0 2.2 0:02.61 zabbix_proxy
                    6379 zabbix 20 5 11284 2764 1732 S 0 0.5 0:37.64 zabbix_proxy
                    6380 zabbix 20 5 11284 2760 1728 S 0 0.5 0:37.22 zabbix_proxy
                    6381 zabbix 20 5 11284 2760 1728 S 0 0.5 0:37.98 zabbix_proxy
                    6382 zabbix 20 5 11284 2760 1728 S 0 0.5 0:37.96 zabbix_proxy
                    6387 zabbix 20 5 11284 2760 1728 S 0 0.5 0:37.90 zabbix_proxy
                    6388 zabbix 20 5 11284 2764 1732 S 0 0.5 0:37.31 zabbix_proxy
                    6389 zabbix 30 5 7748 1228 844 S 0 0.2 0:00.00 zabbix_proxy
                    6390 zabbix 30 5 7748 1228 844 S 0 0.2 0:00.00 zabbix_proxy
                    6391 zabbix 30 5 7748 1228 844 S 0 0.2 0:00.00 zabbix_proxy
                    6392 zabbix 30 5 7748 1228 844 S 0 0.2 0:00.00 zabbix_proxy
                    6393 zabbix 30 5 7748 1228 844 S 0 0.2 0:00.00 zabbix_proxy
                    6394 zabbix 21 5 7748 1272 884 S 0 0.2 0:00.05 zabbix_proxy
                    6395 zabbix 20 5 7748 1268 880 S 0 0.2 0:00.00 zabbix_proxy
                    6396 zabbix 20 5 11124 2388 1496 S 0 0.5 0:00.18 zabbix_proxy
                    6397 zabbix 20 5 7748 1240 844 S 0 0.2 0:00.93 zabbix_proxy
                    6398 zabbix 20 5 7748 1240 844 S 0 0.2 0:00.93 zabbix_proxy
                    6399 zabbix 21 5 7748 1240 844 S 0 0.2 0:00.96 zabbix_proxy
                    6400 zabbix 20 5 7748 1240 844 S 0 0.2 0:00.96 zabbix_proxy
                    6403 zabbix 20 5 7748 1240 844 S 0 0.2 0:00.80 zabbix_proxy
                    6405 zabbix 20 5 11124 2384 1488 S 0 0.5 0:00.10 zabbix_proxy


                    The memory usage of pid6377 will grow biger and biger.
                    And in the proxy debug log of pid6377
                    ##################
                    6377:20081211:141650 Query [SET CHARACTER SET utf8]
                    6377:20081211:141650 In process_configuration_sync()
                    6377:20081211:141650 In connect_to_server() [192.168.1.127]:10051 [timeout:600]
                    6377:20081211:141650 In get_data_from_server() [requestroxy config]
                    6377:20081211:141650 In send_data_to_server() [{
                    6377:20081211:141650 In recv_data_from_server()
                    6377:20081211:141650 Received [{
                    6377:20081211:141650 In process_proxyconfig()
                    6377:20081211:141650 Query [begin;]
                    6377:20081211:141650 In process_proxyconfig_table() [tablename:drules]
                    6377:20081211:141650 Query [select druleid from drules]
                    6377:20081211:141650 End process_proxyconfig_table()
                    6377:20081211:141650 In process_proxyconfig_table() [tablename:dchecks]
                    6377:20081211:141650 Query [select dcheckid from dchecks]
                    6377:20081211:141650 End process_proxyconfig_table()
                    6377:20081211:141650 In process_proxyconfig_table() [tablename:hosts]
                    6377:20081211:141650 Query [select hostid from hosts]
                    6377:20081211:141650 Query [update hosts set host='A-testhost01_group1',dns='A-testhost01_group1',useip=0,ip='192.168.1.124',port =10050,status=0,useipmi=0,ipmi_port=623,ipmi_autht ype=-1,ipmi_privilege=2,ipmi_username='',ipmi_password= '' where hostid=10269;
                    6377:20081211:141650 End process_proxyconfig_table()
                    6377:20081211:141650 In process_proxyconfig_table() [tablename:items]
                    6377:20081211:141650 Query [select itemid from items]
                    6377:20081211:141650 Query [update items set type=1,snmp_community='public',snmp_oid='1.3.6.1.2 .1.2.2.1.10.2',snmp_port=161,hostid=10269,key_='ke yOutCompletekeyNumber_ab_601',delay=60,status=0,va lue_type=3,trapper_hosts='',units='',multiplier=0, delta=2,snmpv3_securityname='',snmpv3_securityleve l=0,snmpv3_authpassphrase='',snmpv3_privpassphrase ='',formula='1',logtimefmt='',templateid=0,valuema pid=0,delay_flex='',params='',ipmi_sensor='' where itemid=28114;
                    6377:20081211:141651 End process_proxyconfig_table()
                    6377:20081211:141651 Query [commit;]
                    6377:20081211:141651 Sleeping for 299 seconds

                    ##################
                    It means when zabbix proxy get config date from zabbix server and update it's database,the process will eat memory but not free it.
                    Who can tell me the reason.

                    Comment

                    • k-ren
                      Junior Member
                      • Oct 2008
                      • 12

                      #25
                      File:
                      src/zabbix_proxy/proxyconfig/proxyconfig.c
                      Function:
                      process_proxyconfig_table
                      Code:
                      new = zbx_malloc(new, new_alloc * sizeof(zbx_uint64_t));
                      ...
                      old = zbx_malloc(old, old_alloc * sizeof(zbx_uint64_t));
                      ...
                      sql = zbx_malloc(sql, sql_alloc * sizeof(char));
                      ...

                      I found that zbx_free is not be used to release the memory.
                      Is zbx_free neet to be use?
                      I added zbx_free,but did not resolve the problem.

                      Comment

                      • Alexei
                        Founder, CEO
                        Zabbix Certified Trainer
                        Zabbix Certified SpecialistZabbix Certified Professional
                        • Sep 2004
                        • 5654

                        #26
                        Originally posted by k-ren
                        File:
                        src/zabbix_proxy/proxyconfig/proxyconfig.c
                        Function:
                        process_proxyconfig_table
                        Code:
                        new = zbx_malloc(new, new_alloc * sizeof(zbx_uint64_t));
                        ...
                        old = zbx_malloc(old, old_alloc * sizeof(zbx_uint64_t));
                        ...
                        sql = zbx_malloc(sql, sql_alloc * sizeof(char));
                        ...

                        I found that zbx_free is not be used to release the memory.
                        Is zbx_free neet to be use?
                        I added zbx_free,but did not resolve the problem.
                        The code is absolutely fine. Thanks you for the hint in your previous email, it does look like we have a problem in a process, which takes care of configuration updates.
                        Alexei Vladishev
                        Creator of Zabbix, Product manager
                        New York | Tokyo | Riga
                        My Twitter

                        Comment

                        • k-ren
                          Junior Member
                          • Oct 2008
                          • 12

                          #27
                          Alexei
                          I am collecting 2000 snmp items with one proxy.
                          And the ConfigFrequency is 300 seconds.
                          The memory usage of ConfigUpdate process grows bigger very quickly.
                          Could you give me a advice to resove it.
                          Thank you.

                          Comment

                          • Alexei
                            Founder, CEO
                            Zabbix Certified Trainer
                            Zabbix Certified SpecialistZabbix Certified Professional
                            • Sep 2004
                            • 5654

                            #28
                            We are performing more testing yearly next week. Please expect more news soon.
                            Alexei Vladishev
                            Creator of Zabbix, Product manager
                            New York | Tokyo | Riga
                            My Twitter

                            Comment

                            • Sasha
                              Zabbix developer
                              • Sep 2007
                              • 60

                              #29
                              Problem fixed in version pre 1.6.2 rev. 6454. Problem registered in ZABBIX support system as ZBX-628.
                              ZABBIX Developer
                              Riga, Latvia

                              Comment

                              • k-ren
                                Junior Member
                                • Oct 2008
                                • 12

                                #30
                                Originally posted by Sasha
                                Problem fixed in version pre 1.6.2 rev. 6454. Problem registered in ZABBIX support system as ZBX-628.
                                Thank you,and where to the zabbix 1.6.2.
                                I am using 1.6.1 in service, Could you tell me how to fixed this bug on zabbix 1.6.1
                                Last edited by k-ren; 15-12-2008, 13:59.

                                Comment

                                Working...