mirror of
https://github.com/rustfs/rustfs.git
synced 2026-07-26 08:18:18 +00:00
a30357d21e
* feat(storage): add multipart put stage metrics * feat(scripts): add multipart put focus runner * docs(operations): add multipart put server-path guides * chore(scripts): add local rustfs restart helper * docs(observability): add local metrics backend guide * docs(observability): add localized multipart guides * fix(ecstore): validate multipart batching path * feat(obs): add erasure encode overlap metrics * docs(ops): update overlap retest summary * docs(ops): add batchblocks retest matrix * docs(ops): extend overlap candidate summary * docs(ops): capture 8-run overlap summary * feat(storage): switch rename_data to msgpack map * test(storage): add rename_data payload checks * feat(object): add zero_copy_eager put path * docs(ops): add zero_copy_eager put guide * docs(ops): add deeper zero-copy next steps
3.8 KiB
3.8 KiB
Issue #712 zero_copy_eager plain PUT 验证手册
1. 目的
本文用于记录当前 zero_copy_eager plain PUT 路径的实际使用方式、验证命令和当前边界。
这条路径当前的目标不是“端到端完全零拷贝”,而是先把 ordinary PUT 从“只有 zero-copy eligibility / metrics”推进到:
- 真实存在的业务路径
- 真实命中可观测的
put_path - 先减少请求体聚合阶段的额外复制
2. 当前启用条件
当前 zero_copy_eager 只在下面条件同时满足时才会命中:
- 非加密
- 非压缩
- 非 extract 请求
- 对象大小
> 1MiB - 对象大小
<= 32MiB - 请求长度已知
- 不属于需要特殊处理的 aws-chunked 未知长度场景
3. 当前实现边界
这条路径已经是真实业务路径,但当前还不是端到端严格意义上的 zero-copy。
已经做到:
- 请求体 chunk 以
Bytes形式进入zero_copy_eager - 不再先把整个对象拼成一个大
Vec<u8>再进入后续写路径 - 运行时会记录
put_path=zero_copy_eager - 会真实记录
rustfs_zero_copy_write_total
尚未做到:
HashReader之后完全无复制Erasure::encode的 block ingest 完全无复制- shard write 全链路严格 zero-copy
因此当前最准确的描述是:
- 这是 ordinary PUT 的真实 zero-copy eager ingress 路径
- 不是完整的 end-to-end zero-copy write path
4. 推荐验证命令
4.1 启动本地单机多盘 RustFS
env \
RUSTFS_UNSAFE_BYPASS_DISK_CHECK=true \
RUSTFS_ADDRESS=127.0.0.1:9000 \
RUSTFS_ACCESS_KEY=rustfsadmin \
RUSTFS_SECRET_KEY=rustfsadmin \
RUSTFS_RPC_SECRET=rustfs-rpc-secret \
RUSTFS_REGION=us-east-1 \
RUSTFS_CONSOLE_ENABLE=false \
RUSTFS_OBS_ENDPOINT=http://127.0.0.1:4318 \
target/debug/rustfs server \
/private/tmp/issue708-single-node-multidisk/d1 \
/private/tmp/issue708-single-node-multidisk/d2 \
/private/tmp/issue708-single-node-multidisk/d3 \
/private/tmp/issue708-single-node-multidisk/d4
4.2 小面 ordinary PUT 验证
bash scripts/run_put_large_stage_breakdown.sh \
--endpoint http://127.0.0.1:9000 \
--access-key rustfsadmin \
--secret-key rustfsadmin \
--sizes 16MiB,32MiB \
--concurrencies 16 \
--duration 60s \
--rounds 1 \
--retry-per-round 1 \
--retry-sleep-secs 2 \
--cooldown-secs 15 \
--out-dir target/bench/issue712-zero-copy-eager-put-verify
5. 运行时必须核对的指标
5.1 PUT path 命中
必须确认:
rustfs_s3_put_object_path_total{
path=~"zero_copy_eager|small_eager|streaming|stream_compressed"
}
如果看不到 zero_copy_eager:
- 说明本轮没有真正命中这条路径
- 不能据此评价它的收益
5.2 zero-copy write 指标
建议同时看:
rustfs_zero_copy_write_total
rustfs_zero_copy_write_size_bytes_sum
5.3 普通 PUT summary
最终固定读取:
aggregate_median_summary.csv
6. 当前已知结果
当前分支上已经验证过一次小面 ordinary PUT:
16MiB, c16:318.77 MiB/s,851.3ms32MiB, c16:276.38 MiB/s,1846.5ms
并确认运行时命中了:
put_path=zero_copy_eager
这说明:
- 这条路径已经不只是 eligibility / metrics
- 它已经是真实参与 ordinary PUT 的运行时路径
7. 当前最稳妥的使用建议
当前阶段建议把这条路径当作:
- 实验性 ordinary PUT 优化路径
- 需要继续压测验证的真实实现
当前不建议把它描述成:
- 已完成的端到端 zero-copy write path
8. 下一步方向
如果要继续把收益往下穿透,下一阶段优先顺序建议是:
- 先继续验证
zero_copy_eager的普通 PUT 命中率和端到端收益 - 再评估是否要继续下钻
Erasure::encode的 block ingest HashReader层暂时不是第一优先级