how vminsert knows where to send metrics

231 views
Skip to first unread message

Maria Stroe

unread,
Feb 11, 2020, 6:44:26 AM2/11/20
to VictoriaMetrics
Hello,

I want to know how vminsert knows where to send metrics if two vmstorage nodes are configured  in the vminsert. On what rule is vminsert deciding on what node to store the metrics?


Ty in advance.

Aliaksandr Valialkin

unread,
Feb 24, 2020, 4:11:09 PM2/24/20
to Maria Stroe, VictoriaMetrics
Hi Maria!



On Tue, Feb 11, 2020 at 1:44 PM Maria Stroe <maria....@gmail.com> wrote:
Hello,

I want to know how vminsert knows where to send metrics if two vmstorage nodes are configured  in the vminsert. On what rule is vminsert deciding on what node to store the metrics?

vminsert uses consistent hashing (jumphash) over metric name plus all the metric labels in order to choose vmstorage node. A single time series is identified by its name plus all its labels. So vminsert sends all the data for a single time series into a single vmstorage node under normal conditions. This improves data compression and reduces CPU and RAM usage comparing to the case if data for a single time series would be spread over multiple vmstorage nodes. There are a few exception when the data for a single time series can be written to multiple vmstorage nodes:
* When vmstorage node is temporarily unavailable, its data is routed to the remaining healthy vmstorage nodes
* When adding new vmstorage nodes to the cluster, new data for a part of time series will migrate to new vmstorage nodes according to consistent hashing. Note that the old data  remains on the old vmstorage nodes.
* When changing order of `-storageNode` command-line flag values passed to `vminsert`. This shuffles placement for all the time series, so it isn't recommended to change the order of these values. It is recommended adding new storage node addresses to the end of `-storageNode` list in order to avoid such shuffling, since it may hurt cluster performance and resource usage.

Sorry for the delayed reply. BTW, we have more active Slack chat at http://slack.victoriametrics.com/ :) Feel free joining it in order to get timely responses.
 


Ty in advance.

--
You received this message because you are subscribed to the Google Groups "VictoriaMetrics" group.
To unsubscribe from this group and stop receiving emails from it, send an email to victoriametri...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/victoriametrics/8b04b20a-e058-46bf-8181-7aaad22475ec%40googlegroups.com.


--
Best Regards,

Aliaksandr
Reply all
Reply to author
Forward
0 new messages