mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2026-06-08 11:23:53 +03:00
Previously, proxy vmselect (aka 1st level vmselect) performed parsing of MetricBlock received from vmstorage before forwarding it into top vmselect. It required an additional CPU and Memory, which greatly slowed down query requests. This commit changes lib/vmselectapi iterator API, instead of MetricBlock, it returns encoded MetricBlock as a byte slice. It allows to save CPU and memory at proxy vmselect by eliminating need of decoding MetricBlock received from storage. In addition, it adds the following optimizations for proxy vmselect: * reduces memory allocations by using iterator pool * add per storageNode workerItem for iterator Also, it adds optimization for vmstorage, it no longer performs extra memory copy of MetricName for MetricBlock. vmselect and vmstorage metrics vm_vmselect_metric_rows_read_total and vm_metric_rows_read_total were removed, it's not used at any dashboards and rules. New Iterator API doesn't support it. Fixes https://github.com/VictoriaMetrics/VictoriaMetrics/issues/9899