# Warp 基准测试

[MinIO Warp](https://github.com/minio/warp) 是一款单二进制的 S3 性能评估工具，用于测量 GET、PUT 和混合工作负载性能。适合**快速的 bucket 级单操作吞吐数字**——当你既不需要 COSBench 的阶段式调度、也不需要 httpbench 的单 worker 隔离时。

关于何时选用 Warp 而非 [COSBench](/ee-ai-cn/benchmark/s3-api/cosbench.md) 或 [httpbench](/ee-ai-cn/benchmark/s3-api/httpbench.md)，参见[基准测试工具选型](/ee-ai-cn/benchmark/s3-api.md#ji-zhun-ce-shi-gong-ju-xuan-xing)。6 节点 Warp 测试的参考吞吐见[参考性能基线](/ee-ai-cn/benchmark/s3-api.md#can-kao-xing-neng-ji-xian)。

{% hint style="warning" %}
**Warp 与 redirect 模式集群不兼容。** Warp 不跟随 HTTP 307，而 `--list-existing` 会枚举整个 bucket——在一个启用了 redirect 的 6-worker 集群上，5⁄6 的 warp GET 请求会命中 307 并失败。解决方式：

1. 运行 warp 前在集群层面关闭 `alluxio.worker.s3.redirect.enabled`（需要重启 worker），或
2. 改用 [httpbench](/ee-ai-cn/benchmark/s3-api/httpbench.md)——它透明地跟随 307，并且可以只打某一个 worker。

关于哪些客户端受 redirect 影响，参见[部署模式](https://documentation.alluxio.io/ee-ai-cn/benchmark/s3-api/pages/byWXUfjCc1iGJqCfxSkb#部署模式)。
{% endhint %}

## 先决条件

* **Alluxio worker 可达**：warp 主机能够通过 S3 API 端口（默认 29998）访问。
* **GET 测试需预加载数据**：使用 `bin/alluxio job load --path /path --submit`，并用 `bin/alluxio fs check-cached /path` 验证。或者先用下面的 `warp put` 命令写入数据。
* **redirect 关闭**（`alluxio.worker.s3.redirect.enabled=false`，默认值）——见上面的警告。

## 安装

```shell
# Install via Go
go install github.com/minio/warp@latest

# Or download a binary release from GitHub
```

## 使用

### 场景：PUT 吞吐量（写入）

{% hint style="warning" %}
**Warp PUT 兼容性**：Warp 默认使用 chunked SHA-256 payload 签名方式，Alluxio S3 不支持此格式，会导致写入失败并返回 `InvalidTag` 等错误。所有 `warp put` 命令均需添加 `--disable-sha256-payload=true`。
{% endhint %}

```shell
# Upload 10KB small files
warp put --host=<ALLUXIO_WORKER_IP>:29998 \
         --bucket=warp-benchmark-bucket \
         --duration=60s \
         --obj.size=10KiB \
         --concurrent=16 \
         --disable-sha256-payload=true

# Upload 1GB large files
warp put --host=<ALLUXIO_WORKER_IP>:29998 \
         --bucket=warp-benchmark-bucket \
         --region=us-east-1 \
         --obj.size=1GiB \
         --part.size=32MiB \
         --insecure \
         --concurrent=16 \
         --duration=60s \
         --disable-http-keepalive=false \
         --disable-sha256-payload=true \
         --noclear
```

### 场景：GET 吞吐量（读取）

```shell
# Ensure data exists first (either via warp put above, or pre-loaded directly to S3)
warp get --host=<ALLUXIO_WORKER_IP>:29998 \
         --bucket=warp-benchmark-bucket \
         --concurrent=16 \
         --obj.size=100KiB \
         --duration=1m \
         --prefix=prefix/ \
         --list-existing
```

### 场景：多节点 GET（分布式读取）

跨多台节点运行 warp 时，使用 `--syncstart` 确保所有节点在同一时刻开始测试。如果不使用该参数，先启动的节点会在无竞争的状态下独占带宽一段时间，导致其吞吐数据偏高，聚合结果也失去横向可比性。

```shell
# 在每台 warp 节点上同时运行，使用相同的 --syncstart 时间
warp get --host=<ALLUXIO_WORKER_IP>:29998 \
         --bucket=warp-benchmark-bucket \
         --concurrent=16 \
         --obj.size=100KiB \
         --duration=5m \
         --prefix=prefix/ \
         --list-existing \
         --syncstart=14:30  # 24 小时制本地时间 HH:MM，设置为约 60 秒后
```

每台节点会生成一个本地 `.json.zst` 结果文件，合并后获得聚合统计数据：

```shell
warp merge node1.json.zst node2.json.zst node3.json.zst
```

## 故障排除

* **Warp PUT 失败或返回 `InvalidTag`** — Warp 默认的 chunked SHA-256 payload 签名 Alluxio S3 不支持。所有 `warp put` 命令均需添加 `--disable-sha256-payload=true`。
* **Warp GET 返回错误或 307** — Warp 不跟随 HTTP 307 重定向。确保 `alluxio.worker.s3.redirect.enabled=false`（默认值），或改用 [httpbench](/ee-ai-cn/benchmark/s3-api/httpbench.md)。

跨工具的通用故障排查（缓存命中验证、网络瓶颈、内核调优），参见 hub 页的[性能调优与故障排除](/ee-ai-cn/benchmark/s3-api.md#xing-neng-diao-you-yu-gu-zhang-pai-chu)。

## 另请参阅

* [S3 API 基准测试](/ee-ai-cn/benchmark/s3-api.md) — 概述、参考基线、工具选型、跨工具故障排查
* [COSBench 基准测试](/ee-ai-cn/benchmark/s3-api/cosbench.md) — 适合复杂的多阶段工作负载
* [httpbench 基准测试](/ee-ai-cn/benchmark/s3-api/httpbench.md) — 适合 redirect 模式或单 worker 测量
* [S3 API 设置与配置](/ee-ai-cn/data-access/s3-api.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/s3-api/warp.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.
