Ad Widget

Collapse

slow query wth triggers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pantera
    Member
    • Dec 2014
    • 39

    #1

    slow query wth triggers

    32107:20151117:175309.124 slow query: 0.155889 sec, "select i.itemid,i.hostid,i.status,i.type,i.data_type,i.va lue_type,i.key_,i.snmp_community,i.snmp_oid,i.port ,i.snmpv3_securityname,i.snmpv3_securitylevel,i.sn mpv3_authpassphrase,i.snmpv3_privpassphrase,i.ipmi _sensor,i.delay,i.delay_flex,i.trapper_hosts,i.log timefmt,i.params,i.state,i.authtype,i.username,i.p assword,i.publickey,i.privatekey,i.flags,i.interfa ceid,i.snmpv3_authprotocol,i.snmpv3_privprotocol,i .snmpv3_contextname,i.lastlogsize,i.mtime,i.delta, i.multiplier,i.formula,i.history,i.trends,i.invent ory_link,i.valuemapid,i.units,i.error from items i,hosts h where i.hostid=h.hostid and h.status in (0,1) and i.flags<>2"

    32107:20151117:175309.459 slow query: 0.334838 sec, "select distinct t.triggerid,t.description,t.expression,t.error,t.p riority,t.type,t.value,t.state,t.lastchange,t.stat us from hosts h,items i,functions f,triggers t where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=t.triggerid and h.status in (0,1) and t.flags<>2"
  • kloczek
    Senior Member
    • Jun 2006
    • 1771

    #2
    Originally posted by pantera
    32107:20151117:175309.124 slow query: 0.155889 sec, "select i.itemid,i.hostid,i.status,i.type,i.data_type,i.va lue_type,i.key_,i.snmp_community,i.snmp_oid,i.port ,i.snmpv3_securityname,i.snmpv3_securitylevel,i.sn mpv3_authpassphrase,i.snmpv3_privpassphrase,i.ipmi _sensor,i.delay,i.delay_flex,i.trapper_hosts,i.log timefmt,i.params,i.state,i.authtype,i.username,i.p assword,i.publickey,i.privatekey,i.flags,i.interfa ceid,i.snmpv3_authprotocol,i.snmpv3_privprotocol,i .snmpv3_contextname,i.lastlogsize,i.mtime,i.delta, i.multiplier,i.formula,i.history,i.trends,i.invent ory_link,i.valuemapid,i.units,i.error from items i,hosts h where i.hostid=h.hostid and h.status in (0,1) and i.flags<>2"

    32107:20151117:175309.459 slow query: 0.334838 sec, "select distinct t.triggerid,t.description,t.expression,t.error,t.p riority,t.type,t.value,t.state,t.lastchange,t.stat us from hosts h,items i,functions f,triggers t where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=t.triggerid and h.status in (0,1) and t.flags<>2"
    Your DB storage is struggling with low level cached DB data (you can increase innodb pool) or to many physical read IOs.
    All database content tables like triggers, host, items tables should be so well cached that all selects should be done against cached in memory content of those tables.
    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

    • pantera
      Member
      • Dec 2014
      • 39

      #3
      Originally posted by kloczek
      Your DB storage is struggling with low level cached DB data (you can increase innodb pool) or to many physical read IOs.
      All database content tables like triggers, host, items tables should be so well cached that all selects should be done against cached in memory content of those tables.
      Thanks f reply, I'm not so good on DB, could you give some config examples ?
      I'm using MySQL

      Comment

      • kloczek
        Senior Member
        • Jun 2006
        • 1771

        #4
        Originally posted by pantera
        Thanks f reply, I'm not so good on DB, could you give some config examples ?
        I'm using MySQL
        Do you have OS layer and MySQL engine monitoring on your DB backedn?
        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

        • pantera
          Member
          • Dec 2014
          • 39

          #5
          Originally posted by kloczek
          Do you have OS layer and MySQL engine monitoring on your DB backedn?
          OS is CentOS 6.6 , don't have MySQL Engine Monitoring.
          I tried to use "Jet Profiler for MySQL" but can't connect wit this tool

          Comment

          Working...