VictoriaMetrics 查询性能测试

VictoriaMetrics 查询性能测试

Vectoria Metrics 查询性能测试用例

原本是测试某款产品和 vm的对比, 某款产品没有对比意义,已经移除相关对比数据, 只看vm的查询性能即可

测试结果

对比项 vectoria metircs
写入吞吐 886k/s(1.66m/s)
压缩率(源json) 0.22%
查询性能(1并发) 6.19
查询性能(10并发, 7个用例同时进行10、50、100个时间段查询,统计总用时) 34.18 s
查询性能(50并发) 560.47
查询性能(100并发) 2040.83
查询性能(50并发,47.5w/s写) 575.19

测试方案

单次查询脚本

  1. 双方准备测试用例sql
  2. 用例均通过双方的query api接口进行查询,均通过response中的执行耗时进行用例耗时统计
  3. 循环测试用例,每个用例连续执行3遍,新用例执行前清除系统cache
  4. 收集所有用例执行时间
  5. 分别统计 冷执行(用例第一次执行) 和 热执行(用例第二次和第三次执行)所耗时间
  6. 进行对比
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash
TRIES=3
QUERY_NUM=1
URL='{server_url}/api/v1/query_range'
while read -r query; do
sync
echo 3 | sudo tee /proc/sys/vm/drop_caches >/dev/null
for i in $(seq 1 $TRIES); do
RES=$(curl -s -k "$URL" -H 'Pragma: no-cache' -d 'start=-6h' -d 'step=1h' -d "query=${query}")
#...从response中获取时间,写入result.csv中
done
QUERY_NUM=$((QUERY_NUM + 1))
done <queries.sql

测试并发查询性能:

  1. 生成10、50、100 个时间段
  2. 同时进行10、50、100个时间段查询,并发调用单次执行脚本(循环次数改1,串行执行1-6个用例)
  3. 最终统计每个并发耗时

测试用例

vectoria metrics

1
2
3
4
5
6
max(node_network_transmit_bytes_total{instance="host-100"}[30m])
avg by (instance,device) (node_disk_read_bytes_total{instance=~"host-100|host-102|host-103|host-110|host-122|host-180"})
sum(rate(node_vmstat_pgmajfault[30m]))
avg by(instance, device) (rate(node_disk_flush_requests_total{instance=~"host-0|host-10|host-103|host-106|host-108"}[30m]))
avg(rate(node_cpu_seconds_total{mode="idle"}[30m])) * 100
avg by(instance) (node_filesystem_files_free{mountpoint ="/"}) / avg by(instance) (node_filesystem_files{mountpoint="/"})

测试数据

1
vm:   12.1 GiB      38383638978

测试数据说明:

  1. 同时通过prometheus-benchmark 进行打数,2000targets,运行11个小时

单并发

单并发查询性能

image-20260813111524877

多并发

vm

10并发

1
2
3
4
5
6
7
8
9
10
11
12
13
14
root@c-1:/opt/metrics_benchmark/benchmark# python3 async_run_single_vm.py
[(1724817301000, 1724849701000), (1724816641000, 1724834641000), (1724818201000, 1724847001000), (1724816641000, 1724838241000), (1724815981000, 1724826781000), (1724815921000, 1724837521000), (1724819041000, 1724847841000), (1724818201000, 1724843401000), (1724817241000, 1724842441000), (1724818861000, 1724844061000)]
VM Script execution time: 3.43 seconds
VM Script execution time: 3.42 seconds
VM Script execution time: 3.44 seconds
VM Script execution time: 3.42 seconds
VM Script execution time: 3.36 seconds
VM Script execution time: 3.40 seconds
VM Script execution time: 3.43 seconds
VM Script execution time: 3.43 seconds
VM Script execution time: 3.44 seconds
VM Script execution time: 3.41 seconds
Total time for 10 concurrent executions: 3.44 seconds
VM === Total time for 10 concurrent executions: 34.18 seconds

50 并发

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
root@c-1:/opt/metrics_benchmark/benchmark# python3 async_run_single_vm.py
[(1724816701000, 1724845501000), (1724816941000, 1724834941000), (1724818081000, 1724850481000), (1724817121000, 1724853121000), (1724817601000, 1724828401000), (1724818681000, 1724836681000), (1724816821000, 1724838421000), (1724818261000, 1724832661000), (1724816821000, 1724842021000), (1724817601000, 1724842801000), (1724817061000, 1724838661000), (1724819221000, 1724837221000), (1724818201000, 1724850601000), (1724818441000, 1724854441000), (1724817961000, 1724828761000), (1724817961000, 1724853961000), (1724816641000, 1724834641000), (1724818141000, 1724836141000), (1724816521000, 1724845321000), (1724817421000, 1724828221000), (1724816401000, 1724848801000), (1724816341000, 1724837941000), (1724816821000, 1724838421000), (1724819101000, 1724840701000), (1724819341000, 1724844541000), (1724817181000, 1724831581000), (1724816581000, 1724852581000), (1724816281000, 1724830681000), (1724817841000, 1724846641000), (1724818261000, 1724847061000), (1724817001000, 1724845801000), (1724816461000, 1724827261000), (1724816521000, 1724852521000), (1724817601000, 1724853601000), (1724816341000, 1724834341000), (1724815801000, 1724844601000), (1724817361000, 1724842561000), (1724817181000, 1724827981000), (1724816821000, 1724842021000), (1724818081000, 1724846881000), (1724816401000, 1724852401000), (1724818501000, 1724843701000), (1724816161000, 1724841361000), (1724816821000, 1724845621000), (1724816221000, 1724852221000), (1724817241000, 1724831641000), (1724819041000, 1724840641000), (1724818621000, 1724833021000), (1724817241000, 1724842441000), (1724815981000, 1724844781000)]
VM Script execution time: 12.82 seconds
VM Script execution time: 11.43 seconds
VM Script execution time: 12.13 seconds
VM Script execution time: 8.83 seconds
VM Script execution time: 12.51 seconds
VM Script execution time: 11.39 seconds
VM Script execution time: 8.99 seconds
VM Script execution time: 11.61 seconds
VM Script execution time: 12.34 seconds
VM Script execution time: 8.31 seconds
VM Script execution time: 13.33 seconds
VM Script execution time: 7.81 seconds
VM Script execution time: 8.31 seconds
VM Script execution time: 8.51 seconds
VM Script execution time: 10.38 seconds
VM Script execution time: 9.19 seconds
VM Script execution time: 6.23 seconds
VM Script execution time: 12.31 seconds
VM Script execution time: 8.74 seconds
VM Script execution time: 8.47 seconds
VM Script execution time: 8.54 seconds
VM Script execution time: 12.71 seconds
VM Script execution time: 11.50 seconds
VM Script execution time: 8.61 seconds
VM Script execution time: 11.32 seconds
VM Script execution time: 8.92 seconds
VM Script execution time: 8.51 seconds
VM Script execution time: 11.67 seconds
VM Script execution time: 12.00 seconds
VM Script execution time: 11.77 seconds
VM Script execution time: 12.15 seconds
VM Script execution time: 8.19 seconds
VM Script execution time: 12.27 seconds
VM Script execution time: 13.32 seconds
VM Script execution time: 9.22 seconds
VM Script execution time: 13.60 seconds
VM Script execution time: 11.89 seconds
VM Script execution time: 12.48 seconds
VM Script execution time: 12.72 seconds
VM Script execution time: 13.20 seconds
VM Script execution time: 13.63 seconds
VM Script execution time: 13.57 seconds
VM Script execution time: 12.45 seconds
VM Script execution time: 13.17 seconds
VM Script execution time: 13.28 seconds
VM Script execution time: 13.12 seconds
VM Script execution time: 13.30 seconds
VM Script execution time: 13.44 seconds
VM Script execution time: 13.06 seconds
VM Script execution time: 13.21 seconds
Total time for 50 concurrent executions: 13.79 seconds
VM === Total time for 50 concurrent executions: 560.47 seconds

100并发

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
root@c-1:/opt/metrics_benchmark/benchmark# python3 async_run_single_vm.py
[(1724815921000, 1724844721000), (1724816401000, 1724830801000), (1724816461000, 1724827261000), (1724817301000, 1724842501000), (1724818501000, 1724850901000), (1724818261000, 1724843461000), (1724817961000, 1724832361000), (1724818201000, 1724847001000), (1724816881000, 1724849281000), (1724819041000, 1724837041000), (1724817841000, 1724828641000), (1724816341000, 1724845141000), (1724819041000, 1724847841000), (1724819281000, 1724840881000), (1724817421000, 1724828221000), (1724817061000, 1724842261000), (1724816521000, 1724827321000), (1724816521000, 1724848921000), (1724815861000, 1724844661000), (1724815861000, 1724830261000), (1724817541000, 1724853541000), (1724816761000, 1724827561000), (1724816161000, 1724848561000), (1724816581000, 1724827381000), (1724815801000, 1724848201000), (1724816161000, 1724830561000), (1724817721000, 1724850121000), (1724818441000, 1724840041000), (1724817421000, 1724849821000), (1724818861000, 1724833261000), (1724818201000, 1724832601000), (1724816761000, 1724849161000), (1724817481000, 1724849881000), (1724817421000, 1724831821000), (1724816701000, 1724841901000), (1724817661000, 1724832061000), (1724816761000, 1724831161000), (1724818081000, 1724836081000), (1724819341000, 1724840941000), (1724817301000, 1724835301000), (1724816101000, 1724848501000), (1724816521000, 1724845321000), (1724818021000, 1724839621000), (1724816821000, 1724849221000), (1724816521000, 1724834521000), (1724818141000, 1724839741000), (1724818981000, 1724847781000), (1724818381000, 1724832781000), (1724817301000, 1724835301000), (1724818141000, 1724828941000), (1724816821000, 1724838421000), (1724816101000, 1724848501000), (1724817541000, 1724846341000), (1724816941000, 1724845741000), (1724816101000, 1724848501000), (1724816161000, 1724830561000), (1724816581000, 1724841781000), (1724818921000, 1724847721000), (1724817961000, 1724853961000), (1724819281000, 1724837281000), (1724818741000, 1724840341000), (1724816881000, 1724838481000), (1724818801000, 1724851201000), (1724819041000, 1724829841000), (1724817661000, 1724839261000), (1724818021000, 1724854021000), (1724816821000, 1724842021000), (1724817061000, 1724842261000), (1724815921000, 1724830321000), (1724818021000, 1724846821000), (1724817601000, 1724853601000), (1724817781000, 1724835781000), (1724818861000, 1724833261000), (1724817241000, 1724842441000), (1724817841000, 1724853841000), (1724817901000, 1724846701000), (1724815801000, 1724837401000), (1724817121000, 1724842321000), (1724816881000, 1724845681000), (1724817301000, 1724828101000), (1724817841000, 1724850241000), (1724818861000, 1724854861000), (1724817181000, 1724827981000), (1724818921000, 1724829721000), (1724816701000, 1724852701000), (1724817181000, 1724842381000), (1724817001000, 1724831401000), (1724816041000, 1724844841000), (1724817301000, 1724853301000), (1724816401000, 1724845201000), (1724815861000, 1724851861000), (1724818081000, 1724854081000), (1724819281000, 1724830081000), (1724817061000, 1724835061000), (1724819041000, 1724833441000), (1724816221000, 1724848621000), (1724819221000, 1724848021000), (1724819041000, 1724829841000), (1724817301000, 1724835301000), (1724815981000, 1724844781000)]
VM Script execution time: 11.02 seconds
VM Script execution time: 7.95 seconds
VM Script execution time: 15.76 seconds
VM Script execution time: 12.07 seconds
VM Script execution time: 15.05 seconds
VM Script execution time: 15.00 seconds
VM Script execution time: 10.98 seconds
VM Script execution time: 9.41 seconds
VM Script execution time: 14.18 seconds
VM Script execution time: 8.94 seconds
VM Script execution time: 10.79 seconds
VM Script execution time: 9.51 seconds
VM Script execution time: 10.20 seconds
VM Script execution time: 8.07 seconds
VM Script execution time: 8.40 seconds
VM Script execution time: 10.96 seconds
VM Script execution time: 11.23 seconds
VM Script execution time: 12.80 seconds
VM Script execution time: 12.80 seconds
VM Script execution time: 10.00 seconds
VM Script execution time: 15.14 seconds
VM Script execution time: 9.38 seconds
VM Script execution time: 18.31 seconds
VM Script execution time: 8.38 seconds
VM Script execution time: 16.81 seconds
VM Script execution time: 18.21 seconds
VM Script execution time: 15.55 seconds
VM Script execution time: 13.88 seconds
VM Script execution time: 18.62 seconds
VM Script execution time: 17.40 seconds
VM Script execution time: 17.79 seconds
VM Script execution time: 23.02 seconds
VM Script execution time: 17.93 seconds
VM Script execution time: 19.08 seconds
VM Script execution time: 17.04 seconds
VM Script execution time: 19.84 seconds
VM Script execution time: 16.44 seconds
VM Script execution time: 16.21 seconds
VM Script execution time: 14.43 seconds
VM Script execution time: 20.52 seconds
VM Script execution time: 23.60 seconds
VM Script execution time: 24.74 seconds
VM Script execution time: 26.58 seconds
VM Script execution time: 22.71 seconds
VM Script execution time: 19.55 seconds
VM Script execution time: 21.66 seconds
VM Script execution time: 23.53 seconds
VM Script execution time: 22.74 seconds
VM Script execution time: 22.65 seconds
VM Script execution time: 19.17 seconds
VM Script execution time: 22.15 seconds
VM Script execution time: 23.06 seconds
VM Script execution time: 20.99 seconds
VM Script execution time: 22.85 seconds
VM Script execution time: 23.71 seconds
VM Script execution time: 22.49 seconds
VM Script execution time: 24.08 seconds
VM Script execution time: 24.38 seconds
VM Script execution time: 25.26 seconds
VM Script execution time: 24.36 seconds
VM Script execution time: 24.03 seconds
VM Script execution time: 24.64 seconds
VM Script execution time: 23.45 seconds
VM Script execution time: 24.31 seconds
VM Script execution time: 25.84 seconds
VM Script execution time: 23.86 seconds
VM Script execution time: 24.70 seconds
VM Script execution time: 25.43 seconds
VM Script execution time: 24.95 seconds
VM Script execution time: 25.21 seconds
VM Script execution time: 25.47 seconds
VM Script execution time: 25.06 seconds
VM Script execution time: 26.00 seconds
VM Script execution time: 24.22 seconds
VM Script execution time: 25.38 seconds
VM Script execution time: 25.66 seconds
VM Script execution time: 25.67 seconds
VM Script execution time: 25.80 seconds
VM Script execution time: 25.20 seconds
VM Script execution time: 25.74 seconds
VM Script execution time: 26.34 seconds
VM Script execution time: 25.87 seconds
VM Script execution time: 26.17 seconds
VM Script execution time: 25.38 seconds
VM Script execution time: 25.91 seconds
VM Script execution time: 26.28 seconds
VM Script execution time: 26.16 seconds
VM Script execution time: 25.70 seconds
VM Script execution time: 26.39 seconds
VM Script execution time: 26.04 seconds
VM Script execution time: 26.18 seconds
VM Script execution time: 26.26 seconds
VM Script execution time: 25.78 seconds
VM Script execution time: 26.03 seconds
VM Script execution time: 26.08 seconds
VM Script execution time: 26.14 seconds
VM Script execution time: 26.15 seconds
VM Script execution time: 25.99 seconds
VM Script execution time: 26.02 seconds
VM Script execution time: 26.06 seconds
Total time for 100 concurrent executions: 27.08 seconds
VM === Total time for 100 concurrent executions: 2040.83 seconds

50并发,同时2000targets 写

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
root@c-1:/opt/metrics_benchmark/benchmark# python3 async_run_single_vm.py
[(1724816701000, 1724845501000), (1724816941000, 1724834941000), (1724818081000, 1724850481000), (1724817121000, 1724853121000), (1724817601000, 1724828401000), (1724818681000, 1724836681000), (1724816821000, 1724838421000), (1724818261000, 1724832661000), (1724816821000, 1724842021000), (1724817601000, 1724842801000), (1724817061000, 1724838661000), (1724819221000, 1724837221000), (1724818201000, 1724850601000), (1724818441000, 1724854441000), (1724817961000, 1724828761000), (1724817961000, 1724853961000), (1724816641000, 1724834641000), (1724818141000, 1724836141000), (1724816521000, 1724845321000), (1724817421000, 1724828221000), (1724816401000, 1724848801000), (1724816341000, 1724837941000), (1724816821000, 1724838421000), (1724819101000, 1724840701000), (1724819341000, 1724844541000), (1724817181000, 1724831581000), (1724816581000, 1724852581000), (1724816281000, 1724830681000), (1724817841000, 1724846641000), (1724818261000, 1724847061000), (1724817001000, 1724845801000), (1724816461000, 1724827261000), (1724816521000, 1724852521000), (1724817601000, 1724853601000), (1724816341000, 1724834341000), (1724815801000, 1724844601000), (1724817361000, 1724842561000), (1724817181000, 1724827981000), (1724816821000, 1724842021000), (1724818081000, 1724846881000), (1724816401000, 1724852401000), (1724818501000, 1724843701000), (1724816161000, 1724841361000), (1724816821000, 1724845621000), (1724816221000, 1724852221000), (1724817241000, 1724831641000), (1724819041000, 1724840641000), (1724818621000, 1724833021000), (1724817241000, 1724842441000), (1724815981000, 1724844781000)]
VM Script execution time: 12.81 seconds
VM Script execution time: 13.08 seconds
VM Script execution time: 5.63 seconds
VM Script execution time: 8.95 seconds
VM Script execution time: 12.15 seconds
VM Script execution time: 12.86 seconds
VM Script execution time: 7.99 seconds
VM Script execution time: 5.26 seconds
VM Script execution time: 13.51 seconds
VM Script execution time: 12.39 seconds
VM Script execution time: 12.12 seconds
VM Script execution time: 6.50 seconds
VM Script execution time: 10.12 seconds
VM Script execution time: 10.25 seconds
VM Script execution time: 11.96 seconds
VM Script execution time: 11.65 seconds
VM Script execution time: 5.29 seconds
VM Script execution time: 8.44 seconds
VM Script execution time: 12.98 seconds
VM Script execution time: 11.42 seconds
VM Script execution time: 10.18 seconds
VM Script execution time: 13.78 seconds
VM Script execution time: 12.17 seconds
VM Script execution time: 13.60 seconds
VM Script execution time: 12.07 seconds
VM Script execution time: 6.46 seconds
VM Script execution time: 13.28 seconds
VM Script execution time: 5.26 seconds
VM Script execution time: 6.62 seconds
VM Script execution time: 12.26 seconds
VM Script execution time: 8.62 seconds
VM Script execution time: 11.87 seconds
VM Script execution time: 14.55 seconds
VM Script execution time: 12.98 seconds
VM Script execution time: 12.66 seconds
VM Script execution time: 13.49 seconds
VM Script execution time: 12.19 seconds
VM Script execution time: 14.38 seconds
VM Script execution time: 13.60 seconds
VM Script execution time: 14.45 seconds
VM Script execution time: 14.42 seconds
VM Script execution time: 13.36 seconds
VM Script execution time: 12.80 seconds
VM Script execution time: 13.40 seconds
VM Script execution time: 13.86 seconds
VM Script execution time: 13.54 seconds
VM Script execution time: 13.33 seconds
VM Script execution time: 13.70 seconds
VM Script execution time: 13.49 seconds
VM Script execution time: 13.44 seconds
Total time for 50 concurrent executions: 14.63 seconds
VM === Total time for 50 concurrent executions: 575.19 seconds

Comments

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×