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

Slow queries that lock history syncers when old metrics are pushed to Zabbix server trappers

XMLWordPrintable

    • S25-W30/31
    • 1

      Create thousands of hosts with hundreds of items with history and trend storage.

      push metrics via trapper to the hosts with current timestamps on the items.

      Wait 3 or 4 hours.

      Push more metrics to many of the items across many of the hosts with timestamps (clock) of 3 or 4 hours ago.

      This generates one or more slow queries like so:

      slow query: 833.4347 sec, "select itemid,num,value_min,value_avg,value_max from trends where clock=<TIME_FROM_3-4_HOURS_AGO> and (itemid in (1,2,3,4,5,6,7....) or itemid in (100,101,102,103....) or itemid in (....) or itemid in (...)) order by itemid,clock;"
      

      Before the select query you can also observe several other slow queries occurring before and after like so:

      slow query: 300.56674 sec, "update trends_uint set num=3,value_min=100,value_avg=100,value_max=100 where itemid=123456 and clock=<TIME_FROM_3-4_HOURS_AGO>;"
      

       

      Depending on the timestamps of the metrics being pushed to the trappers, the queries above can repeat a few times for each trends hour that Zabbix is trying to update trends for. I understand these queries, but these queries put locks on the history syncers and then they are unable to sync any other data. Is there a better way to parallelize this to prevent history syncer usage from hitting 100% and allow the other history syncers to continue processing?

            natalja.zabbix Natalja Romancaka
            GRyan337 Ryan Eberly
            Team B
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - Not Specified
                Not Specified
                Logged:
                Time Spent - 16h
                16h