minio/warp由 MinIO 公司开发和维护的,旨在提供对分布式对象存储系统 MinIO 的快速访问,其提供了高性能的上传和下载功能,这使得它非常适合用于模拟多个并发用户对 MinIO 集群进行读写操作的场景。利用minio/warp压测minio集群,开箱即用,很方便~
1.安装 minio/warp
本文采用docker安装的方式
docker pull minio/warp
这个命令是获取最新版本的镜像,如果需要获取指定版本的镜像在后面加上 :版本号 就可以了。
2.利用minio/warp 进行压测
2.1 常用参数介绍
参数 | 释义 |
--benchdata | 指定压测结果文件的名称(包括文件路径) |
--obj.size | 指定对象的大小 |
--host | 指定服务器 |
--access-key | 账号 |
--secret-key | 密码 |
--concurrent | 并发数 |
--obj.randsize | 随机大小 |
--duration | 持续时间 |
--autoterm | 当基准被认为稳定时自动终止 |
2.2 执行压测
参数介绍
参数 | 释义 |
--benchdata /result/put-100 | 指定将压测结果生成到 容器内result文件夹下,文件名为 put-100 (最终生成的文件的名称为 put-100.csv.zst) |
--host=192.168.1.{7...9}:9000 | 压测的环境 7...9 是minio支持的写法,表示 7 8 9 |
--access-key | minio的登录名 |
--secret-key | minio的密码 |
-v /home/test/result:/result | 设置映射 |
docker run --net host --name warp\
-v /home/test/result:/result \
minio/warp put --host=192.168.1.{7...9}:9000 --access-key=minioadmin --secret-key=minioadmin \
--benchdata /result/put-100 \
--concurrent 20 \
--obj.randsize \
--duration 10m0s \
--autoterm
由于warp是运行完之后容器就停止运行了,无法进入容器内部(运行任务的时候也进不去),所以要获取生成的结果文件, 要么是通过 docker cp把文件复制出来(生成的文件默认是直接在根目录下的)
docker cp 0f411107bb2f:warp-mixed-2022-09-27[090405]-rk20.csv.zst /home/test/minio/warp
3.结果分析
3.1 查看结果
warp执行完会把结果打印的控制台,可以在命令后面加上 >result.log 输出到文件,压缩的详细数据存储在.csv.zst后缀的文件中,可以通过 minio/warp analyze 解析文件
docker run --name warp-analyze --net host \
-v /home/test/result/put-100.csv.zst:/result/put-100.csv.zst \
minio/warp analyze --analyze.v /result/put-100.csv.zst >put-100-result-detail.log
3.2 结果分析
warp: Preparing server.
Clearing Prefix "warp-benchmark-bucket/"...warp: Starting benchmark in 3s...
warp: Benchmark starting...
Throughput 110.6MiB/s within 7.500000% for 14.623s. Assuming stability. Terminating benchmark.
warp: Saving benchmark data...
warp: Benchmark data written to "/result/put-100.csv.zst"
----------------------------------------
Operation: PUT
* Average: 111.06 MiB/s, 11.11 obj/s
Throughput by host:
* http://192.168.1.7:9000: Avg: 17.79 MiB/s, 1.78 obj/s
* http://192.168.1.8:9000: Avg: 17.27 MiB/s, 1.73 obj/s
* http://192.168.1.9:9000: Avg: 76.05 MiB/s, 7.61 obj/s
Throughput, split into 57 x 1s:
* Fastest: 121.3MiB/s, 12.13 obj/s
* 50% Median: 111.5MiB/s, 11.15 obj/s
* Slowest: 99.0MiB/s, 9.90 obj/s
warp: Starting cleanup...
Clearing Prefix "warp-benchmark-bucket/0uvYTk18/"...warp: Cleanup Done.
详情
----------------------------------------
Operation: PUT (766). Ran 1m9s. Concurrency: 20. Hosts: 3.
Requests considered: 616:
* Avg: 1.73s, 50%: 917ms, 90%: 4.098s, 99%: 10.721s, Fastest: 176ms, Slowest: 13.593s
Requests by host:
* http://192.168.1.7:9000 - 125 requests:
- Avg: 3.759s Fastest: 1.019s Slowest: 13.593s 50%: 2.801s 90%: 7.984s
* http://192.168.1.8:9000 - 121 requests:
- Avg: 3.907s Fastest: 1.131s Slowest: 12.458s 50%: 3.108s 90%: 7.635s
* http://192.168.1.9:9000 - 520 requests:
- Avg: 833ms Fastest: 176ms Slowest: 2.428s 50%: 771ms 90%: 1.347s
Throughput:
* Average: 111.06 MiB/s, 11.11 obj/s
Throughput by host:
* http://192.168.1.7:9000:
- Average: 17.79 MiB/s, 1.78 obj/s
- Fastest: 31.6MiB/s
- 50% Median: 17.7MiB/s
- Slowest: 9.9MiB/s
* http://192.168.1.8:9000:
- Average: 17.27 MiB/s, 1.73 obj/s
- Fastest: 26.0MiB/s
- 50% Median: 17.3MiB/s
- Slowest: 11.4MiB/s
* http://192.168.1.9:9000:
- Average: 76.05 MiB/s, 7.61 obj/s
- Fastest: 98.9MiB/s
- 50% Median: 76.4MiB/s
- Slowest: 49.7MiB/s
Throughput, split into 57 x 1s:
* Fastest: 121.3MiB/s, 12.13 obj/s (1s, starting 06:26:42 UTC)
* 50% Median: 111.5MiB/s, 11.15 obj/s (1s, starting 06:26:59 UTC)
* Slowest: 99.0MiB/s, 9.90 obj/s (1s, starting 06:26:41 UTC)