VictoriaMetrics/app
Aliaksandr Valialkin b07a02c516
Revert "app/vmselect: fix the way of counting raw samples in single query (#6464)"
This reverts commit 6e395048d3.

Reason for revert: the previous logic was correct.

The purpose of `-search.maxSamplesPerQuery` command-line flag is to limit the amounts of CPU resources,
which could be taken by a single query - see https://docs.victoriametrics.com/#resource-usage-limits .
VictoriaMetrics processes samples in blocks during querying - it reads the block, then unpacks it,
then filters out samples outside the selected time range. This means that it _spends CPU time_
on reading and unpacking of _all the samples_ in every block on the requested time range,
even if only a single sample per each block matches the given time range.

The previous logic was effectively limiting CPU time a single query could take.
The new logic fails limiting CPU time a single query could take in some pathological cases
when only a small fraction of samples per each requested block fit the requested time range.
This allows performing multiplication DoS-attacks by querying very narrow time ranges over historical blocks,
which tend to be full. For example, if the `-search.maxSamplesPerQuery` equals to a billion,
and the query requests a single sample out of 8K samples per each block, this means that the query
may unpack a billion of such blocks without exceeding the limit, e.g. it may unpack and process 8K*1e9=8e12 samples.
This is not what the resource usage limits were created for originally - see https://docs.victoriametrics.com/#resource-usage-limits

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5851
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/pull/6464
2024-06-25 02:43:57 +02:00
..
victoria-logs deployment: build image for vmagent streamaggr benchmark (#6515) 2024-06-24 16:28:50 +02:00
victoria-metrics deployment: build image for vmagent streamaggr benchmark (#6515) 2024-06-24 16:28:50 +02:00
vlinsert app/vlinsert: properly parse timestamps with nanosecond precision at /insert/jsonline HTTP endpoint 2024-06-18 00:23:25 +02:00
vlogsgenerator lib/logstorage: work-in-progress 2024-05-25 00:30:58 +02:00
vlselect lib/logstorage: work-in-progress 2024-06-20 03:10:08 +02:00
vlstorage lib/logstorage: work-in-progress 2024-05-25 21:36:16 +02:00
vmagent deployment: build image for vmagent streamaggr benchmark (#6515) 2024-06-24 16:28:50 +02:00
vmalert deployment: build image for vmagent streamaggr benchmark (#6515) 2024-06-24 16:28:50 +02:00
vmalert-tool deployment: build image for vmagent streamaggr benchmark (#6515) 2024-06-24 16:28:50 +02:00
vmauth deployment: build image for vmagent streamaggr benchmark (#6515) 2024-06-24 16:28:50 +02:00
vmbackup deployment: build image for vmagent streamaggr benchmark (#6515) 2024-06-24 16:28:50 +02:00
vmbackupmanager all: replace old https://docs.victoriametrics.com/vmbackupmanager.html url with the new one - https://docs.victoriametrics.com/vmbackupmanager/ 2024-04-18 02:03:58 +02:00
vmctl app/vmctl/prometheus/prometheus.go: add missing arg to tsdb.OpenDBReadOnly() function after updating github.com/prometheus/prometheus dependency from v0.52.1 to v0.53.0 in 5c55722db4 2024-06-24 23:15:56 +02:00
vmgateway all: replace old https://docs.victoriametrics.com/vmgateway.html url with the new one - https://docs.victoriametrics.com/vmgateway/ 2024-04-18 02:08:18 +02:00
vminsert lib/httpserver: allow reloadAuthKey and configAuthKey to override htt… (#6338) 2024-06-10 12:09:47 +02:00
vmrestore deployment: build image for vmagent streamaggr benchmark (#6515) 2024-06-24 16:28:50 +02:00
vmselect Revert "app/vmselect: fix the way of counting raw samples in single query (#6464)" 2024-06-25 02:43:57 +02:00
vmstorage lib/mergeset: adds tracking for indexdb records drop (#6297) 2024-05-24 14:55:20 +02:00
vmui app/vmui: run make vmui-update after 65f414acee 2024-06-24 23:20:33 +02:00