惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Project Zero
Project Zero
月光博客
月光博客
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
O
OpenAI News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Know Your Adversary
Know Your Adversary
Last Week in AI
Last Week in AI
S
Securelist
Engineering at Meta
Engineering at Meta
博客园 - 司徒正美
P
Privacy & Cybersecurity Law Blog
T
Tailwind CSS Blog
F
Fortinet All Blogs
博客园 - 三生石上(FineUI控件)
Scott Helme
Scott Helme
MyScale Blog
MyScale Blog
P
Proofpoint News Feed
云风的 BLOG
云风的 BLOG
C
Cisco Blogs
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
小众软件
小众软件
U
Unit 42
Microsoft Azure Blog
Microsoft Azure Blog
Hacker News: Ask HN
Hacker News: Ask HN
Hugging Face - Blog
Hugging Face - Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
SecWiki News
SecWiki News
宝玉的分享
宝玉的分享
P
Proofpoint News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hackread – Cybersecurity News, Data Breaches, AI and More
L
Lohrmann on Cybersecurity
IT之家
IT之家
Security Archives - TechRepublic
Security Archives - TechRepublic
I
InfoQ
S
Security @ Cisco Blogs
Webroot Blog
Webroot Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
F
Full Disclosure
D
Darknet – Hacking Tools, Hacker News & Cyber Security
The GitHub Blog
The GitHub Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Jina AI
Jina AI
Cyberwarzone
Cyberwarzone
人人都是产品经理
人人都是产品经理
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
B
Blog RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research

陈少文的网站

巨变与机遇的未来十年 Kubernetes 平台管理软件压力测试方案 使用镜像部署 Hexo 静态页面 终于等到你 - GitHub 镜像仓库服务(ghcr.io) 一起来学 Go --(6)Interface 一起来学 Go --(5)Goroutine 和 Channel 什么是函数式编程 如何在 Kubernetes 集群集成 Kata 柯里化与偏函数 使用 PyGithub 自动创建 Label 软件产品是团队能力的输出 Helm 2 、Helm 3 比较 IoT 变现 Kubernetes 中的 DNS 服务 国内的 Helm 镜像源 Harbor 使用自签证书支持 Https 访问 DevOps 工具链之 Prow 如何使用 kfctl 安装 Kubeflow VS Code 无法下载 Go 插件的工具包 工程师更应具有服务精神 你不知道的 Docker 使用技巧 使用 Docker 运行 Tensorflow 论中国 什么是左移 如何清空 Git 仓库全部历史记录 一禅小和尚 有风吹过厨房 时间的玫瑰 如何在 CentOS 安装 GPU 驱动 开发 Tips(19) 使用 Velero 备份 Kubernetes 集群 Kubernetes Cheat Sheet 开发 Tips(18) 如何构建一个 Java 工程 开发 Tips(17) KubeSpray 安装 Kubernetes 报错 ip in ansible_all_ipv4_addresses 基于 Kubernetes 和 Jenkins 搭建自动化测试系统 在 Kubernetes 上动态创建 Jenkins Slave 使用 Jenkins 进行服务拨测 开发 Tips(16) Kubernetes 签发 Ingress 证书及日常故障运维 Kubernetes 中 Deployment 的基本操作 Kubernetes 中的证书 如何使用 KubeBuilder 开发一个 Operator Kubernetes 1.6.0 安装问题汇总 镜像管理工具 -- Harbor 开发 Tips(15) Docker 如何拉取镜像 开发 Tips(14) 使用 Helm 安装 harbor 开发 Tips(13) 使用 S2I 构建云原生应用 在 Kubernetes 中使用 emptyDir、hostPath、localVolume 开发 Tips(12) 开发 Tips(11) 代码质量分析工具 SonarQube 使用 Kubeadm 安装 Kubernetes 集群 一起来学 Go --(4)常用函数 Kubernetes 中的 Ceph Kubernetes 之 Volumes Kubernetes 之 Labels、Selectors 开发 Tips(10) 开源正在重构商业模式 Kubernetes 之网络 Kubernetes 之 API 使用 Helm 和 Operator 快速部署 Prometheus Kubernetes 复杂有状态应用管理框架 -- Operator Kubernetes 的包管理器 -- Helm 一起来学 Go --(3)Go Modules 如何一步一步地优化博客方案 kubectl 实用指南 Kubernetes 中的基本概念 搭建远程 Kubernetes 开发环境 大公司和小公司的 ToB 思路 开发 Tips(9) Go 入门指南 一起来学 Go --(2)数据与逻辑结构 如何预防 Web 富文本中的 XSS 攻击 django-xss-cleaner 云工作时代 一起来学 Go --(1)背景与特点 SaaS 开发团队的不同阶段 你不知道的 Git 使用技巧 输出既服务 微服务设计 继续奔跑 开发 Tips(8) 从账户安全到二次验证 Django 性能之数据库查询优化 Django 性能之分库分表 敏捷开发之研发流程 打造一致性的团队 开发 Tips(7) Pytest 进阶学习之 Mock PaaS 部署之 buildpack Go 开发配置 领域输出才是 PaaS 的核心竞争力 Pytest 入门学习 开发 Tips(6) 如何使用 Jenkins、Docker、GitLab 搭建 Django 自动化部署流程
3FS 的一些性能测试
微信公众号 · 2025-03-11 · via 陈少文的网站

1. 硬件测试

有两块 NVMe SSD SAMSUNG MZQL27T6HBLA-00A07,两个节点组成的 3FS 集群,每个节点有 4 个 IB 网口。

1.1 单线程

  • 磁盘 FIO 128 K,读
1
fio -numjobs=1 -fallocate=none -iodepth=2 -ioengine=libaio -direct=1 -rw=read -bs=128K --group_reporting -size=100M -time_based -runtime=30 -name=fio-test -directory=/data/fio
1
Jobs: 1 (f=1): [R(1)][100.0%][r=2211MiB/s][r=17.7k IOPS][eta 00m:00s]
  • 磁盘 FIO 128 K,写
1
fio -numjobs=1 -fallocate=none -iodepth=2 -ioengine=libaio -direct=1 -rw=write -bs=128K --group_reporting -size=100M -time_based -runtime=30 -name=fio-test -directory=/data/fio
1
Jobs: 1 (f=1): [W(1)][100.0%][w=3703MiB/s][w=29.6k IOPS][eta 00m:00s]
  • 磁盘 FIO 4 M,读
1
fio -numjobs=1 -fallocate=none -iodepth=2 -ioengine=libaio -direct=1 -rw=read -bs=4M --group_reporting -size=100M -time_based -runtime=30 -name=fio-test -directory=/data/fio
1
Jobs: 1 (f=1): [R(1)][100.0%][r=6294MiB/s][r=1573 IOPS][eta 00m:00s]
  • 磁盘 FIO 4 M,写
1
fio -numjobs=1 -fallocate=none -iodepth=2 -ioengine=libaio -direct=1 -rw=write -bs=4M --group_reporting -size=100M -time_based -runtime=30 -name=fio-test -directory=/data/fio
1
Jobs: 1 (f=1): [W(1)][100.0%][w=3872MiB/s][w=967 IOPS][eta 00m:00s]
  • 小结

设备单线程

块大小操作读/写速率IOPS
128 K2211 MiB/s17.7k
128 K3703 MiB/s29.6k
4 M6294 MiB/s1573
4 M3872 MiB/s967

1.2 多线程

  • 磁盘 FIO 128 K,读
1
fio -numjobs=128 -fallocate=none -iodepth=2 -ioengine=libaio -direct=1 -rw=read -bs=128K --group_reporting -size=100M -time_based -runtime=30 -name=fio-test -directory=/data/fio
1
Jobs: 128 (f=128): [R(128)][100.0%][r=6237MiB/s][r=49.9k IOPS][eta 00m:00s]
  • 磁盘 FIO 128 K,写
1
fio -numjobs=128 -fallocate=none -iodepth=2 -ioengine=libaio -direct=1 -rw=write -bs=128K --group_reporting -size=100M -time_based -runtime=30 -name=fio-test -directory=/data/fio
1
Jobs: 128 (f=128): [W(128)][100.0%][w=3873MiB/s][w=31.0k IOPS][eta 00m:00s]
  • 磁盘 FIO 4 M,读
1
fio -numjobs=128 -fallocate=none -iodepth=2 -ioengine=libaio -direct=1 -rw=read -bs=4M --group_reporting -size=100M -time_based -runtime=30 -name=fio-test -directory=/data/fio
1
Jobs: 128 (f=128): [R(128)][100.0%][r=5832MiB/s][r=1458 IOPS][eta 00m:00s]
  • 磁盘 FIO 4 M,写
1
fio -numjobs=128 -fallocate=none -iodepth=2 -ioengine=libaio -direct=1 -rw=write -bs=4M --group_reporting -size=100M -time_based -runtime=30 -name=fio-test -directory=/data/fio
1
Jobs: 128 (f=128): [W(128)][100.0%][w=3768MiB/s][w=941 IOPS][eta 00m:00s]
  • 小结

设备多线程

块大小操作读/写速率IOPS
128 K6237 MiB/s49.9k
128 K3873 MiB/s31.0k
4 M5832 MiB/s1458
4 M3768 MiB/s941

1.3 IB 设备

  • 设备列表,4 个端口
1
2
3
4
5
6
ibdev2netdev

mlx5_0 port 1 ==> ibp25s0 (Up)
mlx5_1 port 1 ==> ibp59s0 (Up)
mlx5_2 port 1 ==> ibp155s0 (Up)
mlx5_3 port 1 ==> ibp187s0 (Up)
  • IB 连接速率 53.125 Gbps
1
2
3
4
iblinkinfo  |grep h100

          65   19[  ] ==( 4X        53.125 Gbps Active/  LinkUp)==>     172    1[  ] "h100-03 mlx5_0" ( )
          ...
  • IB 带宽测试

在其中一台机器上运行

1
ib_write_bw -d mlx5_0 -x3

在另外一台机器上运行

1
ib_write_bw -d mlx5_0 -x3 x.x.x.x --report_gbits
1
2
3
4
5
---------------------------------------------------------------------------------------
 #bytes     #iterations    BW peak[Gb/sec]    BW average[Gb/sec]   MsgRate[Mpps]
Conflicting CPU frequency values detected: 2101.000000 != 3100.000000. CPU Frequency is not max.
 65536      5000             195.48             195.46             0.372806
---------------------------------------------------------------------------------------

单网口能提供 195 Gbps 的带宽。

2 3FS 挂载主机测试

2.1 单线程

  • 磁盘 FIO 128 K,读
1
fio -numjobs=1 -fallocate=none -iodepth=2 -ioengine=libaio -direct=1 -rw=read -bs=128K --group_reporting -size=100M -time_based -runtime=30 -name=fio-test -directory=/3fs/stage/fio
1
Jobs: 1 (f=1): [R(1)][100.0%][r=937MiB/s][r=7497 IOPS][eta 00m:00s]
  • 磁盘 FIO 128 K,写
1
fio -numjobs=1 -fallocate=none -iodepth=2 -ioengine=libaio -direct=1 -rw=write -bs=128K --group_reporting -size=100M -time_based -runtime=30 -name=fio-test -directory=/3fs/stage/fio
1
Jobs: 1 (f=1): [W(1)][100.0%][w=25.6MiB/s][w=205 IOPS][eta 00m:00s]
  • 磁盘 FIO 4 M,读
1
fio -numjobs=1 -fallocate=none -iodepth=2 -ioengine=libaio -direct=1 -rw=read -bs=4M --group_reporting -size=100M -time_based -runtime=30 -name=fio-test -directory=/3fs/stage/fio
1
Jobs: 1 (f=1): [R(1)][100.0%][r=7736MiB/s][r=1934 IOPS][eta 00m:00s]
  • 磁盘 FIO 4 M,写
1
fio -numjobs=1 -fallocate=none -iodepth=2 -ioengine=libaio -direct=1 -rw=write -bs=4M --group_reporting -size=100M -time_based -runtime=30 -name=fio-test -directory=/3fs/stage/fio
1
Jobs: 1 (f=1): [W(1)][100.0%][w=1233MiB/s][w=308 IOPS][eta 00m:00s]
  • 小结

3FS 单线程

块大小操作读/写速率IOPS
128 K937 MiB/s7497
128 K25.6 MiB/s205
4 M7736 MiB/s1934
4 M1233 MiB/s308

2.2 多线程

  • 磁盘 FIO 128 K,读
1
fio -numjobs=128 -fallocate=none -iodepth=2 -ioengine=libaio -direct=1 -rw=read -bs=128K --group_reporting -size=100M -time_based -runtime=30 -name=fio-test -directory=/3fs/stage/fio
1
Jobs: 128 (f=128): [R(128)][100.0%][r=6941MiB/s][r=55.5k IOPS][eta 00m:00s]
  • 磁盘 FIO 128 K,写
1
fio -numjobs=128 -fallocate=none -iodepth=2 -ioengine=libaio -direct=1 -rw=write -bs=128K --group_reporting -size=100M -time_based -runtime=30 -name=fio-test -directory=/3fs/stage/fio
1
Jobs: 128 (f=128): [W(128)][100.0%][w=209MiB/s][w=1675 IOPS][eta 00m:00s]
  • 磁盘 FIO 4 M,读
1
fio -numjobs=128 -fallocate=none -iodepth=2 -ioengine=libaio -direct=1 -rw=read -bs=4M --group_reporting -size=100M -time_based -runtime=30 -name=fio-test -directory=/3fs/stage/fio
1
Jobs: 128 (f=128): [R(128)][100.0%][r=11.9GiB/s][r=3056 IOPS][eta 00m:00s]
  • 磁盘 FIO 4 M,写
1
fio -numjobs=128 -fallocate=none -iodepth=2 -ioengine=libaio -direct=1 -rw=write -bs=4M --group_reporting -size=100M -time_based -runtime=30 -name=fio-test -directory=/3fs/stage/fio
1
Jobs: 128 (f=128): [W(128)][100.0%][w=1648MiB/s][w=412 IOPS][eta 00m:00s]
  • 小结

3FS 多线程

块大小操作读/写速率IOPS
128 K6941 MiB/s55.5k
128 K209 MiB/s1675
4 M11.9 GiB/s3056
4 M1648 MiB/s412

2.3 3FS VS 设备

  • 单线程
块大小操作设备读/写速率设备 IOPS3FS 读/写速率3FS IOPS
128 K2211 MiB/s17.7k937 MiB/s7497
128 K3703 MiB/s29.6k25.6 MiB/s205
4 M6294 MiB/s15737736 MiB/s1934
4 M3872 MiB/s9671233 MiB/s308
  • 多线程
块大小操作设备 读/写速率设备 IOPS3FS 读/写速率3FS IOPS
128 K6237 MiB/s49.9k6941 MiB/s55.5k
128 K3873 MiB/s31.0k209 MiB/s1675
4 M5832 MiB/s145811.9 GiB/s3056
4 M3768 MiB/s9411648 MiB/s412

3FS 适合多线程、大块读写操作,单线程、小块读写操作性能较差。

3. Checkpoint 存储速度测试

 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
import os
import time
import torch
import argparse

def generate_dummy_checkpoint(size_mb):
    """
    生成一个指定大小的模拟 checkpoint 文件。
    size_mb: 文件大小,以 MB 为单位。
    """
    # 1 MB = 1024 * 1024 bytes
    size_bytes = size_mb * 1024 * 1024
    dummy_data = torch.rand(size_bytes // 4)  # 随机生成数据,假设每个浮点数占 4 字节
    return {"dummy_data": dummy_data}

def save_checkpoint(checkpoint, save_dir):
    """
    将 checkpoint 保存到指定目录,并测量存储速度。
    checkpoint: 要保存的 checkpoint 数据。
    save_dir: 保存目录。
    """
    start_time = time.time()
    os.makedirs(save_dir, exist_ok=True)
    save_path = os.path.join(save_dir, "checkpoint.pt")
    torch.save(checkpoint, save_path)
    end_time = time.time()

    # 计算存储速度 (MB/s)
    file_size_mb = os.path.getsize(save_path) / (1024 * 1024)
    duration = end_time - start_time
    speed_mb_per_sec = file_size_mb / duration

    return speed_mb_per_sec

def main():
    parser = argparse.ArgumentParser(description="Test storage speed for checkpoint saving.")
    parser.add_argument("--size_mb", type=int, default=100, help="Size of the dummy checkpoint in MB (default: 100MB)")
    parser.add_argument("--save_dir", type=str, default="/3fs/stage/checkpoint", help="Directory to save the checkpoint (default: /3fs/stage/checkpoint)")
    args = parser.parse_args()

    # 生成模拟的 checkpoint 文件
    checkpoint = generate_dummy_checkpoint(args.size_mb)

    # 数与存储速度
    speed = save_checkpoint(checkpoint, args.save_dir)
    print(f"Storage speed: {speed:.2f} MB/s")

if __name__ == "__main__":
    main()

保存为 torch_test.py

  • 安装依赖
1
pip install torch -i  https://pypi.mirrors.ustc.edu.cn/simple
  • 测试
1
python3 torch_test.py --size_mb 2000 --save_dir /3fs/stage/checkpoint
1
Storage speed: 246.50 MB/s

4. 模型加载速度测试

这里的测试模型为 DeepSeek R1

1
2
3
4
5
6
ls /3fs/stage/model

chkp.py                            model-00084-of-000163.safetensors
config.json                        model-00085-of-000163.safetensors
configuration_deepseek.py          model-00086-of-000163.safetensors
...

模型大小约 687 GB

1
2
3
du -sh /3fs/stage/model

687G    /3fs/stage/model

在两台 H100 上同时执行测试命令

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
python3 -u -m sglang.launch_server \
    --model-path /3fs/stage/model \
    --quantization fp8 \
    --tp 16 \
    --chunked-prefill-size 4096 \
    --dist-init-addr ${MASTER_ADDR}:${PORT} \
    --nnodes ${NNODES} \
    --node-rank ${NODE_RANK} \
    --trust-remote-code \
    --host 0.0.0.0 \
    --port 30000

一共进行了两次测试,第一次加载时间为 10 分钟,第二次加载时间为 12 分钟。

可以看到两个 Pod 同时加载模型时,总的带宽约为 1~1.2 GBps。

5. 4K 随机读写

4K 读写决定了小文件的读写性能,对于构建等场景会有较大的影响。这是在另外一套 5 个存储节点的 3FS 集群上进行的测试。

  • 主机磁盘 4K 随机读写
1
fio -direct=1 -iodepth=128 -rw=randwrite -ioengine=libaio -bs=4k -size=100m -numjobs=1 -runtime=1000 -group_reporting --allow_mounted_write=1 -name=Rand_Write_Testing -filename=/data1/fiofile
1
  WRITE: bw=97.5MiB/s (102MB/s), 97.5MiB/s-97.5MiB/s (102MB/s-102MB/s), io=100MiB (105MB), run=1026-1026msec
1
fio -direct=1 -iodepth=128 -rw=randread -ioengine=libaio -bs=4k -size=100m -numjobs=1 -runtime=1000 -group_reporting --allow_mounted_write=1 -name=Rand_Read_Testing -filename=/data1/fiofile
1
   READ: bw=1408MiB/s (1477MB/s), 1408MiB/s-1408MiB/s (1477MB/s-1477MB/s), io=100MiB (105MB), run=71-71msec
  • 3FS 4K 随机读写
1
fio -direct=1 -iodepth=128 -rw=randwrite -ioengine=libaio -bs=4k -size=100m -numjobs=1 -runtime=1000 -group_reporting --allow_mounted_write=1 -name=Rand_Write_Testing -filename=/mnt/3fs/fiofile
1
  WRITE: bw=746KiB/s (764kB/s), 746KiB/s-746KiB/s (764kB/s-764kB/s), io=99.9MiB (105MB), run=137123-137123msec
1
fio -direct=1 -iodepth=128 -rw=randread -ioengine=libaio -bs=4k -size=100m -numjobs=1 -runtime=1000 -group_reporting --allow_mounted_write=1 -name=Rand_Read_Testing -filename=/mnt/3fs/fiofile
1
  WRITE: bw=127MiB/s (133MB/s), 127MiB/s-127MiB/s (133MB/s-133MB/s), io=100MiB (105MB), run=789-789msec
  • 小结
操作读/写速率设备
4K 读1408 MiB/s磁盘
4K 写97.5 MiB/s磁盘
4K 读127 MiB/s3FS
4K 写746 KiB/s3FS