For future students of the course "DevOps Practices and Tools" we prepared a translation of interesting material.
We also invite everyone to participate in the open webinar “Prometheus: Quick Start”. During the lesson, participants will consider the Prometheus architecture and how it works with metrics, as well as how to generate alerts and events in the system.
Recently VictoriaMetrics introduced the ability to scrap Prometheus targets . And now we can compare apples to apples: how many resources are used by Prometheus and VictoriaMetrics when scraping large amounts node_exporter
.
Benchmark setup
Testing was carried out in Google Compute Engine on four machines (instances):
node exporter v1.0.1 . e2-standard-4 : 4 vCPU, 16 RAM, 1 HDD. ,
node_exporter
. Prometheus VictoriaMetricsnode_exporter
.node_exporter
nginx .node_exporter
, .
e2-highmem-4 Prometheus v2.22.2 VictoriaMetrics v1.47.0 : 4 vCPU, 32 RAM, 1 . VictoriaMetrics, Prometheus , (
-promscrape.config = prometheus.yml
VictoriaMetrics-config.file = prometheus.yml
Prometheus).prometheus.yml
Jinja2:
global:
scrape_interval: 10s
scrape_configs:
- job_name: node_exporter
static_configs:
{% for n in range(3400) %}
- targets: ['host-node-{{n}}:9100']
labels:
host_number: cfg_{{n}}
role: node-exporter
env: prod
{% endfor %}
host-node-{{n}}
node_exporter
. /etc/hosts
. 3400 node_exporter
.
e2-standard-2 VictoriaMetrics Prometheus. VictoriaMetrics ,
node_exporter
VictoriaMetrics Prometheus. .
node_exporter
:
node_exporter
— , Prometheus.
node_exporter
( , , -, . .), Prometheus .
VictoriaMetrics, Prometheus nodeexporter . 24 .
VictoriaMetrics Prometheus :
(ingestion rate): 280 . / .
(active time series): 2,8
(samples scraped and stored): 24,5
:
![Disk space usage. Disk space usage.](https://habrastorage.org/getpro/habr/upload_files/4be/57f/941/4be57f9417ef740e2ce8ba328e67f2e6.png)
Prometheus 15 , VictoriaMetrics — . VictoriaMetrics 4 . :
VictoriaMetrics: 7,2 . 0,3 (7,2 / 24,5 ).
Prometheus: 52,3 (32,3 + 18 WAL). 52,3 / 24,5 = 2,1 . , Prometheus 7 (2,1 / 0,3) .
-:
![Disk I / O: Bytes written per second. Disk I / O: Bytes written per second.](https://habrastorage.org/getpro/habr/upload_files/ef3/036/3b9/ef30363b92ea799a37a84b847a1cac56.png)
![Disk I / O: Bytes read per second. Disk I / O: Bytes read per second.](https://habrastorage.org/getpro/habr/upload_files/325/a4a/cd5/325a4acd5680a2d5989e67cabdd9911d.png)
, Prometheus 95 / , VictoriaMetrics 15 /.
:
![CPU usage, vCPU cores. CPU usage, vCPU cores.](https://habrastorage.org/getpro/habr/upload_files/ee9/aa9/273/ee9aa927370b5a921d76720974b3f2da.png)
3400
node_exporter
1,5–1,75 vCPU. , vCPU 4000node_exporter
.
:
![Using RSS memory. Using RSS memory.](https://habrastorage.org/getpro/habr/upload_files/5a8/81d/29b/5a881d29bfedd376bc1a33678f228e36.png)
VictoriaMetrics 4,3 RSS-, Prometheus 6,5 14 23 . OOM , Kubernetes Prometheus. , 32 , . , Prometheus , , - OOM, .
, Prometheus 5,3 (23 / 4,3 ) , VictoriaMetrics.
Prometheus, VictoriaMetrics vCPU. , InfluxDB TimescaleDB.
VictoriaMetrics 5 7 Prometheus node_exporter
. .
P.S. VictoriaMetrics, . VictoriaMetrics ( ). , .