Comments (7)
it takes most of the work time to receive data from the vmstorage-s (since there are many of them)
vmselect receives data from vmstorages in parallel, so many vmstorages shouldn't delay data retrieval. It should be opposite, the more vmstorages you have the faster they process the search query and respond with data.
and aggregate data on vmselect-s.
If aggregation on vmselect takes significant amount of time this is where vertical scaling should help. Please note, vmselect does query processing in parallel fashion, running a separate worker per each available CPU. These workers are responsinble for unpacking data received from vmstorages and performing concurrent calculations before the final merge.
from victoriametrics.
Ok, we will try to increase our vmstorage nodes count too. Thanks!
from victoriametrics.
Do I understand correctly that if it is not possible to vertically scale vmselects, then it remains only to introduce sequential processing through recording rules /stream aggregation, which will cause its inconveniences (the names of the metrics will not match their original names) and delays?
It is correct. vmselect can't shard query execution among other vmselects. Hence, it can be scaled only vertically for resource-intensive queries.
The scaling logic is the following:
- If you have intensive read queries - prefer a smaller number of vmselects with high resource capacity
- If you have many light-weight queries - prefer a bigger number of vmselects with light resource capacity
These two approaches could be mixed. For example, alerting and recording rules are usually considered as lightweight load, since they usually select short time intervals. So the ruler (vmalert) could be configured to "talk to" a fleet of many lightweight queries.
If you have some heavy Grafana dashboards or other queriers, configure them to "talk to" a fleet of smaller number of heavy vmselects which would crunch big amounts of data faster.
Or maybe there are other ways to improve the cluster's read performance? I will be glad for any advice/thoughts.
I'd recommend starting with https://docs.victoriametrics.com/troubleshooting/#slow-queries.
Recommendations from the doc and query tracing could help to understand where the bottleneck is. It could be vmselect's compute resource, but it also could be vmstorage disk IO, vmstorage CPU, network between vmstorage and vmselect. In this case, scaling vmselects will have no effect on query latency.
from victoriametrics.
- If you have intensive read queries - prefer a smaller number of vmselects with high resource capacity
- If you have many light-weight queries - prefer a bigger number of vmselects with light resource capacity
These two approaches could be mixed. For example, alerting and recording rules are usually considered as lightweight load, since they usually select short time intervals. So the ruler (vmalert) could be configured to "talk to" a fleet of many lightweight queries. If you have some heavy Grafana dashboards or other queriers, configure them to "talk to" a fleet of smaller number of heavy vmselects which would crunch big amounts of data faster.
An interesting idea, we will try to divide them, thank you!
Or maybe there are other ways to improve the cluster's read performance? I will be glad for any advice/thoughts.
I'd recommend starting with https://docs.victoriametrics.com/troubleshooting/#slow-queries. Recommendations from the doc and query tracing could help to understand where the bottleneck is. It could be vmselect's compute resource, but it also could be vmstorage disk IO, vmstorage CPU, network between vmstorage and vmselect. In this case, scaling vmselects will have no effect on query latency.
We looked at it. In our case (judging by the traces), it takes most of the work time to receive data from the vmstorage
-s (since there are many of them) and aggregate data on vmselect
-s.
from victoriametrics.
it takes most of the work time to receive data from the vmstorage-s (since there are many of them)
vmselect receives data from vmstorages in parallel, so many vmstorages shouldn't delay data retrieval. It should be opposite, the more vmstorages you have the faster they process the search query and respond with data.
I mean a lot of data blocks to retreive for query. Now we have 5 vmstorage servers. Do you have any recommendations on how many hosts it is optimal to have, depending on the amount of data? Maybe we should increase their number for better performance...
and aggregate data on vmselect-s.
If aggregation on vmselect takes significant amount of time this is where vertical scaling should help. Please note, vmselect does query processing in parallel fashion, running a separate worker per each available CPU. These workers are responsinble for unpacking data received from vmstorages and performing concurrent calculations before the final merge.
Yes, I understand that, but we can no longer scale vmselect vertically(
from victoriametrics.
Do you have any recommendations on how many hosts it is optimal to have, depending on the amount of data?
It doesn't depend on amount of data, but rather on the bottlenecks during query processing. For example, you have 5 storage nodes, each has local disk with 100MB/s read throughput. Then one query (in the best case) can utilize 500MB/s read speed. If you add 5 more vmstorage nodes, then one query would be able to utilize 1000MB/s.
In short, scaling number for vmstorage nodes is similar to scaling the number of concurrent workers - it is always beneficial. Unless the vmselect is the bottleneck and can't process the received data fast enough.
Scaling vmstorage nodes makes sense up to 30-50 nodes. After that, the fragility of network starts to kick-in increasing query latency because of higher probability of network lag.
from victoriametrics.
Closing question as answered. Feel free to re-open or create a new issue if you still have questions.
from victoriametrics.
Related Issues (20)
- The metric `process_resident_memory_bytes` was not calculated correctly HOT 1
- Global WITH templates in vmselect / vmsingle
- vmauth cannot start with empty configuration. HOT 1
- vmauth: default httpserver incorrectly exposed
- VMAlert oauth2 error HOT 1
- vmagent using k8s endpoint role for pod role jobs HOT 6
- kube-scheduler and kube-controller-manager scrape tls issue on victoria-metrics-k8s-stack HOT 3
- Add type parameter to prometheus metrics in vmagent HOT 2
- GetRowsDiff func takes a lot of time when vmagent pushes kube-state-metrics data HOT 3
- Using Query from the beginning of the day HOT 1
- Allow VMAlert to replay alerts till the current time HOT 2
- Different authorization for different targets, via relabel
- IndexDB data consuming more space after pod restarts HOT 3
- Indexdb add scroll mode when vmstorage -retentionPeriod parameter set very long time
- vmalert-tool: process won't exit when no rule is defined under group HOT 1
- Duplicate metrics in a scrape break Prometheus scraping HOT 1
- Victorialogs can't parse syslog timestamps HOT 4
- victorialogs vmui: unresponsive after query execution HOT 1
- Random inconsistent results in query operations from the same instance and exporter HOT 3
- vmalert: replay exit with status 0 when generated samples are not successfully pushed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from victoriametrics.