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

Latest data page slowness

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • None
    • None
    • None

      Steps to reproduce:

      1. Create some some hosts with thousands of items or even one host with something like 50000 items. Each of the items should have several tags
      2. Run a query for just that host in the Latest data page
      3. Notice how long it takes to complete

       

      In app/controllers/CControllerLatest.php the first query for items should include a 'limit' option that is set with $search_limit. If the $select_items_cnt has not exceeded $search_limit, then the query queries for all that hosts' items, which is unecessary since it is never returned to the user's browser anyway.

       

      In the for-loop, we should set this on each pass of the foreach loop:

       

      $limit = $search_limit - $select_items_cnt;

       

      And then in the API::Item()->get we should add this after 'preservekeys' => true

       

      'limit' => $limit

       

      In my environment, with a host having 40000 items, the original query took 4.2 minutes. This is on SSD, bare metal Dell R640. When I add the code modifications above, the query takes 3.6 seconds. My GUI search limit is set to 5000, so this is still very good performance (3.6 seconds). This is a problem because the Home tab in Latest data typically has no filters set, so if the first host it gets has thousands of items the GUI experience will be very bad for the users.

            bmickiewicz Bartosz Mickiewicz
            GRyan337 Ryan Eberly
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: