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

推荐订阅源

H
Hackread – Cybersecurity News, Data Breaches, AI and More
U
Unit 42
Vercel News
Vercel News
Martin Fowler
Martin Fowler
云风的 BLOG
云风的 BLOG
爱范儿
爱范儿
MongoDB | Blog
MongoDB | Blog
J
Java Code Geeks
F
Fortinet All Blogs
MyScale Blog
MyScale Blog
C
Check Point Blog
N
Netflix TechBlog - Medium
Microsoft Azure Blog
Microsoft Azure Blog
aimingoo的专栏
aimingoo的专栏
博客园_首页
WordPress大学
WordPress大学
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
IT之家
IT之家
Last Week in AI
Last Week in AI
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
Jina AI
Jina AI
V
Visual Studio Blog
小众软件
小众软件

陈少文的网站

巨变与机遇的未来十年 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)
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. 参考


微信公众号