Slower subquery

22 views
Skip to first unread message

Vishnu B

unread,
Mar 5, 2020, 1:07:53 PM3/5/20
to Prometheus Users
i am using subqueries to get the 95th percentile data for the network traffic. But it is slower to excute with 30days of interval.
is it a best idea to use recording rules for this, so that it will be faster?

Regards,
Vishnu 

Vishnu B

unread,
Mar 6, 2020, 2:03:54 AM3/6/20
to Prometheus Users
Can someone please reply with your experience using recording rules vs subquery performance?

Regards
Vishnu

Christian Hoffmann

unread,
Mar 8, 2020, 4:39:38 PM3/8/20
to Vishnu B, Prometheus Users
Hi,
Recording rules are probably not faster per-se, but they do help in
pre-calculating values which you will need later, i.e. they shift some
of the work to the rule evaluation interval instead of the ad-hoc query
(from Grafana or something).

So yes, if you have a query which calculates something, it can help to
set up a recording rule in order to get snappier dashboards, which can
be simplified to the query of a single metric.

Kind regards,
Christian
Reply all
Reply to author
Forward
0 new messages