# 基准测试

基准测试是验证您的 Alluxio 集群是否配置最佳并为您的工作负载提供预期性能的关键步骤。本节提供使用行业标准工具来衡量 Alluxio 在不同用例中的性能的指南。

这些指南提供了标准化的测试方法，但您的结果会因您独特的硬件、网络和集群配置而异。

## 硬件选型

### Worker 节点

三条原则决定了 Worker 硬件能否产出有意义的基准测试结果：

1. **存储不能成为瓶颈**：Alluxio 直接从 page store 提供缓存数据。Worker 应配备本地 NVMe SSD——网络附加存储或机械硬盘会在 Alluxio 达到极限之前先成为瓶颈。
2. **网络不能成为瓶颈**：Worker 的网络带宽上限决定了可观测的最大吞吐量。建议使用至少 25 Gbps 网络；饱和测试推荐 100 Gbps 或更高。
3. **测量极限性能时，消除磁盘 I/O**：如果想将 Alluxio 的服务开销与存储延迟隔离开来，可将 page store 配置到内存文件系统（`/dev/shm`，在 Linux 上即 tmpfs，无需额外配置）：

   ```yaml
   worker:
     pagestore:
       hostPath: /dev/shm/alluxio   # tmpfs — 内存支撑，无磁盘 I/O
       size: 120Gi
       reservedSize: 10Gi
   ```

   > RAM 缓存是易失性的——Worker pod 重启后数据丢失。适用于基准测试场景，以及数据集可从 UFS 重新加载的 AI 推理工作负载。

基准测试中常用的 Alluxio Worker 机型：

| 云平台 | 机型                  | 存储           | 网络       |
| --- | ------------------- | ------------ | -------- |
| AWS | `i3en.metal`        | 8× NVMe SSD  | 100 Gbps |
| OCI | `BM.DenseIO.E5.128` | 12× NVMe SSD | 100 Gbps |

### 负载生成节点

负载生成器（COSBench driver、Warp client、fio client）不需要本地快速存储——它们只负责生成请求并通过网络接收数据，网络带宽和 CPU 是关键约束。

常用负载生成机型：AWS `c5n.metal`（100 Gbps，无本地 NVMe）。典型配置：4× `c5n.metal` driver 对打一个 4-worker Alluxio 集群。

## 基准测试指南

* [**POSIX API 基准测试**](/ee-ai-cn/benchmark/benchmarking-posix-performance.md) 使用 Fio 衡量 Alluxio FUSE 挂载的读/写吞吐量和 IOPS，适用于通用 POSIX 工作负载。
* [**S3 API 基准测试**](/ee-ai-cn/benchmark/s3-api.md) — Alluxio S3 兼容 API 的参考基线与工具选型。三种工具各有独立文档：
  * [使用 COSBench](/ee-ai-cn/benchmark/s3-api/cosbench.md) — 复杂的多阶段混合工作负载。
  * [使用 Warp](/ee-ai-cn/benchmark/s3-api/warp.md) — 单二进制、快速 bucket 级读取；仅限 redirect 关闭的集群。
  * [使用 httpbench](/ee-ai-cn/benchmark/s3-api/httpbench.md) — 约 50 行 Go 小工具，适合单 worker、redirect 感知测量。
* [**MLPerf 基准测试**](/ee-ai-cn/benchmark/benchmarking-ml-training-performance-with-mlperf.md) 使用 MLPerf Storage 基准测试模拟机器学习训练作业的 I/O 模式，评估 Alluxio 的加速效果。

## 从基准测试到优化

运行基准测试后，下一步是分析结果并调整您的集群。有关配置 Alluxio 以实现最大性能的详细指南，请参阅我们的[**性能优化**](/ee-ai-cn/performance.md)指南。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.alluxio.io/ee-ai-cn/benchmark.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
