-
Notifications
You must be signed in to change notification settings - Fork 4.1k
util/metric: histograms and other metrics are too damn expensive #30644
Copy link
Copy link
Closed
Labels
C-performancePerf of queries or internals. Solution not expected to change functional behavior.Perf of queries or internals. Solution not expected to change functional behavior.T-kvKV TeamKV TeamX-wontfixClosed as we're not going to fix it, even though it's a legitimate issue.Closed as we're not going to fix it, even though it's a legitimate issue.
Description
As seen in this comment, the metrics that we update frequently (e.g. the txn metrics) have a measurable cost probably because of their internal mutual exclusion. In particular, the histograms seems to be expensive.
The PR linked above avoids updating a transaction restarts histogram in the common case when transactions don't restart. Such histograms would benefit from an optimized path for an "expected value" where they should be as cheap as a counter.
Beyond that, we could try techniques for eliminating mutual exclusion - like maintaining metrics per PCPU and aggregating them on demand. I think I've heard RocksDB does this for their stats.
Jira issue: CRDB-4826
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-performancePerf of queries or internals. Solution not expected to change functional behavior.Perf of queries or internals. Solution not expected to change functional behavior.T-kvKV TeamKV TeamX-wontfixClosed as we're not going to fix it, even though it's a legitimate issue.Closed as we're not going to fix it, even though it's a legitimate issue.