Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-17275

Optimize database queries in maintenance processing

XMLWordPrintable

    • Sprint 61 (Feb 2020), Sprint 62 (Mar 2020)
    • 1

      To find out if the event must be suppressed timers must find the hosts related to each event. This is done in several steps:

      1. prepare event queries
        1. get events to be checked
        2. get functionids associated to each event
        3. get current event suppress data
      2. get maintenance data for each query
        1. find hosts associated with each query (functionids->itemids->hostids)
        2. update event maintenance status based on host maintenance
          ...

      The 1.1 step can be quite slow on Oracle databases:

      22924:20200127:082441.109 slow query: 26.800426 sec, "select functionid,triggerid from functions where (triggerid between 1306534 and 1306538 or triggerid between 1306566 and 1306570 or triggerid bet...
      

      Possible solutions:

      1. each timer processes subset of events, selected by mod(eventid, <timer processes>). Use similar approach to select functionids:
        select f.triggerid,f.functionid from problem p left join functions f on f.triggerid=p.objectid where p.source=0 and p.object=0 and mod(p.eventid, <timer forks>)
      2. remove step 1.1 and change 2.1 to locate trigger, parse out functionids, then process like before (functionids->itemids->hostids)

      Need to compare performance before deciding on best fix.

            wiper Andris Zeila
            wiper Andris Zeila
            Team A
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: