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

Patch to boost up wiget problems

XMLWordPrintable

    • Icon: Patch request Patch request
    • Resolution: Duplicate
    • Icon: Critical Critical
    • None
    • 3.4.14
    • Frontend (F)

      Hello.
      I have  problem to slow load wiget problem.
      Problem looks like in

      https://support.zabbix.com/browse/ZBX-13635
      https://support.zabbix.com/browse/ZBX-13417

       

      If 30 users open one time  them dashboard, that case very big cpu load on sql.

       

      My environment:

      • zabbix-3.14 6CPU 8RAM
      • mysql 5.7 8 cpu 32RAM
      • 5 proxys

       

      Problem are in a long sql query.

      SELECT DISTINCT e.eventid,
             e.clock,
              e.ns,
              e.objectid,
              er?.r_eventid
      FROM events e
      LEFT JOIN event_recovery er?
          ON er?.eventid=e.eventid
      WHERE e.source=?
              AND e.object=?
              AND e.objectid=?
              AND e.eventid<=?
              AND e.value=?
      ORDER BY  e.eventid DESC limit ?
      

      A fix slow query execution  by adding  2 indexes.

      It boost up query execution in 1000 times.

      From 30 sec to 0.03

      It low down cpu load from 90% to 30%

      If you yet run zabbix database

      ALTER TABLE `event_recovery` ADD INDEX `event_recovery_idx_eventid_eventid` (`eventid`,`r_eventid`);
      ALTER TABLE `events` ADD INDEX `events_idx_source_object_object_value_eventi` (`source`,`object`,`objectid`,`value`,`eventid`);
      

      If you make clean install, you can change mysql sheme (in attach)

      patch -p1  schema.sql boost_load_wiget_problems_schema.patch
      

      This path only added 2 indexes. It safe for using.

       

       

            Unassigned Unassigned
            nikolay_lebedev Nikolay Lebedev
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: