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

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Microsoft Azure Blog
Microsoft Azure Blog
大猫的无限游戏
大猫的无限游戏
月光博客
月光博客
V
V2EX
PCI Perspectives
PCI Perspectives
Latest news
Latest news
博客园 - 三生石上(FineUI控件)
C
CERT Recently Published Vulnerability Notes
W
WeLiveSecurity
Last Week in AI
Last Week in AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
P
Palo Alto Networks Blog
T
The Exploit Database - CXSecurity.com
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
WordPress大学
WordPress大学
V
Vulnerabilities – Threatpost
H
Heimdal Security Blog
Attack and Defense Labs
Attack and Defense Labs
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Hacker News: Ask HN
Hacker News: Ask HN
博客园 - 叶小钗
V
Visual Studio Blog
Jina AI
Jina AI
P
Proofpoint News Feed
罗磊的独立博客
SecWiki News
SecWiki News
J
Java Code Geeks
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
L
LINUX DO - 热门话题
Security Archives - TechRepublic
Security Archives - TechRepublic
The Hacker News
The Hacker News
Hugging Face - Blog
Hugging Face - Blog
N
News and Events Feed by Topic
NISL@THU
NISL@THU
T
Tailwind CSS Blog
T
Tenable Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Recent Announcements
Recent Announcements
H
Hacker News: Front Page
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
T
Tor Project blog
宝玉的分享
宝玉的分享
Help Net Security
Help Net Security
S
Security Affairs
Microsoft Security Blog
Microsoft Security Blog
Google DeepMind News
Google DeepMind News
F
Fortinet All Blogs
G
GRAHAM CLULEY

陈少文的网站

巨变与机遇的未来十年 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 自动化部署流程
AGFS 文件系统性能测试
微信公众号 · 2026-03-26 · via 陈少文的网站

Please enable Javascript to view the contents

1. 安装 wrk

2. localfs 性能测试

2.1 1KB 小文件测试

  • 写文件
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
cat > put-1k.lua <<"EOF"
wrk.method = "PUT"
wrk.body = string.rep("a", 1024)
wrk.headers["Content-Type"] = "text/plain"
counter = 0
local WRAP = 500000
request = function()
    counter = counter + 1
    local n = ((counter - 1) % WRAP) + 1
    local filename = "/local/perf-1k/test_" .. n .. ".txt"
    local path = "/api/v1/files?path=" .. filename
    return wrk.format(nil, path)
end
EOF
1
curl -X POST "http://127.0.0.1:8080/api/v1/directories?path=/local/perf-1k"
1
wrk -t4 -c40 -d30s -s put-1k.lua "http://127.0.0.1:8080"
1
2
3
4
5
6
7
8
Running 30s test @ http://127.0.0.1:8080
  4 threads and 40 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     3.12ms    3.50ms  84.69ms   93.89%
    Req/Sec     3.72k     1.02k    5.72k    73.92%
  443823 requests in 30.01s, 59.68MB read
Requests/sec:  14791.48
Transfer/sec:      1.99MB
  • 读文件
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
cat > get-1k.lua <<"EOF"
wrk.method = "GET"
counter = 0
local WRAP = 10000
request = function()
    counter = counter + 1
    local n = ((counter - 1) % WRAP) + 1
    local filename = "/local/perf-1k/test_" .. n .. ".txt"
    local path = "/api/v1/files?path=" .. filename
    return wrk.format(nil, path)
end
EOF
1
wrk -t4 -c40 -d30s -s get-1k.lua "http://127.0.0.1:8080"
1
2
3
4
5
6
7
8
Running 30s test @ http://127.0.0.1:8080
  4 threads and 40 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   738.85us    1.30ms  26.79ms   89.12%
    Req/Sec    31.47k     3.02k   43.39k    68.42%
  3756234 requests in 30.01s, 4.00GB read
Requests/sec: 125169.00
Transfer/sec:    136.32MB
  • 列目录
1
wrk -t4 -c40 -d30s "http://127.0.0.1:8080/api/v1/directories?path=/local/perf-1k"
1
2
3
4
5
6
7
8
Running 30s test @ http://127.0.0.1:8080/api/v1/directories?path=/local/perf-1k
  4 threads and 40 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   925.62ms  106.94ms   1.51s    78.75%
    Req/Sec    13.39      8.78    50.00     80.42%
  1275 requests in 30.04s, 21.39GB read
Requests/sec:     42.44
Transfer/sec:    729.28MB

2.2 4KB 小文件测试

  • 写文件
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
cat > put-4k.lua <<"EOF"
wrk.method = "PUT"
wrk.body = string.rep("a", 4096)
wrk.headers["Content-Type"] = "text/plain"
counter = 0
local WRAP = 500000
request = function()
    counter = counter + 1
    local n = ((counter - 1) % WRAP) + 1
    local filename = "/local/perf-4k/test_" .. n .. ".txt"
    local path = "/api/v1/files?path=" .. filename
    return wrk.format(nil, path)
end
EOF
1
curl -X POST "http://127.0.0.1:8080/api/v1/directories?path=/local/perf-4k"
1
wrk -t4 -c40 -d30s -s put-4k.lua "http://127.0.0.1:8080"
1
2
3
4
5
6
7
8
Running 30s test @ http://127.0.0.1:8080
  4 threads and 40 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     2.91ms    2.01ms  40.08ms   89.01%
    Req/Sec     3.69k   695.58     5.41k    76.67%
  441076 requests in 30.01s, 59.31MB read
Requests/sec:  14698.37
Transfer/sec:      1.98MB
  • 读文件
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
cat > get-4k.lua <<"EOF"
wrk.method = "GET"
counter = 0
local WRAP = 10000
request = function()
    counter = counter + 1
    local n = ((counter - 1) % WRAP) + 1
    local filename = "/local/perf-4k/test_" .. n .. ".txt"
    local path = "/api/v1/files?path=" .. filename
    return wrk.format(nil, path)
end
EOF
1
wrk -t4 -c40 -d30s -s get-4k.lua "http://127.0.0.1:8080"
1
2
3
4
5
6
7
8
Running 30s test @ http://127.0.0.1:8080
  4 threads and 40 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   636.01us    0.94ms  21.45ms   87.28%
    Req/Sec    23.76k     2.11k   29.46k    70.33%
  2836971 requests in 30.02s, 11.18GB read
Requests/sec:  94511.49
Transfer/sec:    381.53MB
  • 列目录
1
wrk -t4 -c40 -d30s "http://127.0.0.1:8080/api/v1/directories?path=/local/perf-4k"
1
2
3
4
5
6
7
8
Running 30s test @ http://127.0.0.1:8080/api/v1/directories?path=/local/perf-4k
  4 threads and 40 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   942.52ms  101.78ms   1.39s    76.91%
    Req/Sec    13.16      9.05    70.00     80.40%
  1256 requests in 30.06s, 20.91GB read
Requests/sec:     41.79
Transfer/sec:    712.24MB

2.3 512KB 大文件测试

  • 写文件
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
cat > put-512k.lua <<"EOF"
wrk.method = "PUT"
wrk.body = string.rep("a", 512 * 1024)
wrk.headers["Content-Type"] = "text/plain"
counter = 0
local WRAP = 500000
request = function()
    counter = counter + 1
    local n = ((counter - 1) % WRAP) + 1
    local filename = "/local/perf-512k/test_" .. n .. ".txt"
    local path = "/api/v1/files?path=" .. filename
    return wrk.format(nil, path)
end
EOF
1
curl -X POST "http://127.0.0.1:8080/api/v1/directories?path=/local/perf-512k"
1
wrk -t4 -c40 -d30s -s put-512k.lua "http://127.0.0.1:8080"
1
2
3
4
5
6
7
8
Running 30s test @ http://127.0.0.1:8080
  4 threads and 40 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    24.56ms    4.42ms  61.28ms   78.08%
    Req/Sec   402.50     38.55   525.00     68.42%
  48111 requests in 30.02s, 6.56MB read
Requests/sec:   1602.42
Transfer/sec:    223.78KB
  • 读文件
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
cat > get-512k.lua <<"EOF"
wrk.method = "GET"
counter = 0
local WRAP = 10000
request = function()
    counter = counter + 1
    local n = ((counter - 1) % WRAP) + 1
    local filename = "/local/perf-512k/test_" .. n .. ".txt"
    local path = "/api/v1/files?path=" .. filename
    return wrk.format(nil, path)
end
EOF
1
wrk -t4 -c40 -d30s -s get-512k.lua "http://127.0.0.1:8080"
1
2
3
4
5
6
7
8
Running 30s test @ http://127.0.0.1:8080
  4 threads and 40 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     2.33ms    1.33ms  23.09ms   78.83%
    Req/Sec     3.37k   231.83     3.95k    70.50%
  403535 requests in 30.08s, 197.09GB read
Requests/sec:  13415.50
Transfer/sec:      6.55GB
  • 列目录
1
wrk -t4 -c40 -d30s "http://127.0.0.1:8080/api/v1/directories?path=/local/perf-512k"
1
2
3
4
5
6
7
8
Running 30s test @ http://127.0.0.1:8080/api/v1/directories?path=/local/perf-512k
  4 threads and 40 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    93.34ms   11.21ms 143.77ms   68.84%
    Req/Sec   107.37     13.03   151.00     75.81%
  12837 requests in 30.03s, 23.49GB read
Requests/sec:    427.46
Transfer/sec:    800.87MB

3. 总结

40 并发、4 线程、持续 30 秒测试

  • 1k 小文件测试
插件场景Requests/sec平均延迟传输速率非 2xx 比例
localfs写文件14791.483.12ms1.99MB0%
localfs读文件125169.00738.85us136.32MB0%
localfs列目录42.44925.62ms729.28MB0%
  • 4k 小文件测试
插件场景Requests/sec平均延迟传输速率非 2xx 比例
localfs写文件14698.372.91ms1.98MB0%
localfs读文件94511.49636.01us381.53MB0%
localfs列目录41.79942.52ms712.24MB0%
  • 512KB 大文件测试
插件场景Requests/sec平均延迟传输速率非 2xx 比例
localfs写文件1602.4224.56ms223.78KB0%
localfs读文件13415.502.33ms6.55GB0%
localfs列目录427.4693.34ms800.87MB0%

512KB 下列目录的文件数量少,因此性能更好。

整体来看,localfs 的性能还是不错的。

4. 参考


微信公众号