Ad Widget

Collapse

Very slow query on first chart load

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • andk
    Junior Member
    • Sep 2017
    • 1

    #1

    Very slow query on first chart load

    Hello,

    Zabbix 3.2.6
    MariaDB 10.0.32


    I have this chart where SWAP usage is shown. The first load of chart is awfully slow.
    Using Zabbix debug mode I see the following query taking ages to complete, which is the root cause of slow chart load time. Refreshing same chart works as expected and takes minimum time to complete.

    Code:
    SQL (21.381727): SELECT MIN(h.clock) AS min_clock FROM (SELECT MIN(h.clock) AS clock FROM trends_uint h WHERE h.itemid='213324') h
    charts.php:128 → CView->render() → include() → CScreenChart->get() → get_min_itemclock_by_graphid() → get_min_itemclock_by_itemid() → DBselect() in include/graphs.inc.php:241
    Running this query directly on SQL server returns instantly. What can bet the source of the problem?

    Some other charts hangs on executing :
    Code:
    SQL (23.044088): SELECT MIN(h.clock) AS min_clock FROM (SELECT MIN(h.clock) AS clock FROM trends_uint h WHERE h.itemid='472259' UNION ALL SELECT MIN(h.clock) AS clock FROM trends_uint h WHERE h.itemid='472260' UNION ALL SELECT MIN(h.clock) AS clock FROM trends_uint h WHERE h.itemid='472261' UNION ALL SELECT MIN(h.clock) AS clock FROM trends_uint h WHERE h.itemid='472264') h
    charts.php:128 → CView->render() → include() → CScreenChart->get() → get_min_itemclock_by_graphid() → get_min_itemclock_by_itemid() → DBselect() in include/graphs.inc.php:241
  • torabkheslat
    Junior Member
    • Jan 2018
    • 2

    #2
    HI Guy

    What was the result?

    Comment

    Working...