# Fio 测试概览

## Fio 测试概览

Fio（Flexible I/O Tester）是一款功能强大的开源工具，用于对存储系统的性能进行基准测试。 它支持各种 I/O 操作，包括顺序和随机读/写，同时支持高度自定义的工作负载。 Fio 可跨平台，在 Linux、Windows 和 macOS 系统上运行，并提供诸如IOPS、带宽和延迟等详细的性能指标。

本页文档展示Alluxio 的 fio 测试结果。测试案例可应用于其他存储系统。

## 测试详情

### 测试环境

所有实例均位于 AWS 的同一可用区域。

Alluxio Worker

* 1个[i3en.metal](https://aws.amazon.com/ec2/instance-types/i3en/)实例
* 由8个nvme固态硬盘组成的 Raid 0（通过 mdadm 命令创建）
* 100Gbps 网络带宽
* Ubuntu 24.04
* 一个 Alluxio worker进程
* 一个 ETCD 节点

Alluxio Client

* 1 个[c5n.metal](https://aws.amazon.com/ec2/instance-types/c5/) 实例
* 100Gbps 网络带宽
* Ubuntu 24.04
* Fuse 3.16.2
* 一个 Alluxio FUSE 进程

### 单个worker 和Client测试

此场景测试的是单个 100GB 大文件的读取性能。 测试中仅涉及 1 个client和 1 个worker。

#### 测试准备

将一个100GB文件放入UFS。 在此基准测试中，我们使用与 Worker 和client位于同一区域的 S3 桶。

#### 顺序读

在 Alluxio client 上运行以下命令:

```bash
fio -iodepth=1 -rw=read -ioengine=libaio -bs=<block_size> -numjobs=<numjobs> -group_reporting -size=100G -filename=/mnt/alluxio/100gb -name=read_test --readonly -direct=1 --runtime=60
```

`numjobs`参数指定执行读取并发数。在此基准测试中，`numjobs`设置为`1`、`32`或`128`。 `bs` 参数指定测试中使用的数据块大小。我们使用 `256k` 测试吞吐量，使用 `4k` 测试 IOPS。

#### 随机读

与热顺序读相同，但参数 `rw` 改为 `randread`。

```bash
fio -iodepth=1 -rw=randread -ioengine=libaio -bs=<block_size> -numjobs=<numjobs> -group_reporting -size=100G -filename=/mnt/alluxio/100gb -name=read_test --readonly -direct=1 --runtime=60
```

## 测试结果摘要

### 单个Worker 和Client 吞吐量（256k大小的数据块）

| 带宽/线程 | 单线程       | 32线程      |
| ----- | --------- | --------- |
| 顺序读   | 2081MiB/s | 8183MiB/s |
| 随机读   | 141MiB/s  | 7504MiB/s |

### 单个Worker 和Client IOPS（4k大小的数据块）

| IOPS/线程 | 单线程   | 32线程  | 128线程 |
| ------- | ----- | ----- | ----- |
| 顺序读     | 55.9k | 244k  | 179k  |
| 随机读     | 1.6k  | 70.1k | 162k  |

* 缓存数据的性能

## 附录 - Alluxio 配置

### 集群配置（"alluxio-site.properties）

```
alluxio.master.hostname=localhost
alluxio.master.journal.type=NOOP
alluxio.security.authorization.permission.enabled=false
alluxio.worker.membership.manager.type=ETCD
alluxio.mount.table.source=ETCD
alluxio.etcd.endpoints=<endpoints>
alluxio.client.list.status.from.ufs.enabled=false
alluxio.worker.page.store.sizes=2TB
alluxio.worker.page.store.page.size=4M
alluxio.worker.page.store.dirs=/data1/worker
alluxio.user.metadata.cache.max.size=2000000
alluxio.dora.client.ufs.fallback.enabled=false
alluxio.user.position.reader.streaming.async.prefetch.thread=256
```

### JVM 选项(`alluxio-env.sh`)

```
ALLUXIO_WORKER_JAVA_OPTS="$ALLUXIO_WORKER_JAVA_OPTS -Xmx24G -Xmx24G -XX:+UseG1GC"
ALLUXIO_FUSE_JAVA_OPTS="$ALLUXIO_FUSE_JAVA_OPTS -Xms48G -Xmx48G -XX:MaxDirectMemorySize=24g  -XX:+UseG1GC"
```

### Fuse 挂载选项

```
-max_background=256 -max_idle_threads=256 -entry_timeout=60 -attr_timeout=60
```


---

# 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/ai-3.4/performance/fio-tests.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.
