You've already forked www.colben.cn
update
This commit is contained in:
@@ -7,11 +7,11 @@ tags: ["linux", "随机读", "随机写"]
|
||||
categories: ["storage"]
|
||||
---
|
||||
|
||||
# 前言
|
||||
## 前言
|
||||
- 随机写会导致磁头不停地换道,造成效率的极大降低
|
||||
- 顺序写磁头几乎不用换道,或者换道的时间很短
|
||||
|
||||
# fio 介绍
|
||||
## fio 介绍
|
||||
- fio的输出报告中的几个关键指标:
|
||||
- slat: 是指从 I/O 提交到实际执行 I/O 的时长(Submission latency)
|
||||
- clat: 是指从 I/O 提交到 I/O 完成的时长(Completion latency)
|
||||
@@ -19,8 +19,8 @@ categories: ["storage"]
|
||||
- bw : 吞吐量
|
||||
- iops: 每秒 I/O 的次数
|
||||
|
||||
# 同步写测试
|
||||
## 同步随机写
|
||||
## 同步写测试
|
||||
### 同步随机写
|
||||
- 使用strace工具查看系统调用
|
||||
```bash
|
||||
strace -f -tt -o /tmp/randwrite.log -D fio -name=randwrite -rw=randwrite \
|
||||
@@ -82,7 +82,7 @@ categories: ["storage"]
|
||||
...
|
||||
```
|
||||
|
||||
## 同步顺序写
|
||||
### 同步顺序写
|
||||
- 测试顺序写
|
||||
```bash
|
||||
strace -f -tt -o /tmp/write.log -D fio -name=write -rw=write \
|
||||
@@ -153,7 +153,7 @@ categories: ["storage"]
|
||||
```
|
||||
- 顺序读不需要反复定位文件偏移量,所以能够专注于写操作
|
||||
|
||||
# 异步顺序写
|
||||
## 异步顺序写
|
||||
- 前面 fio 的测试报告中没有发现slat,那是由于上述都是同步操作,对同步 I/O 来说,由于 I/O 提交和 I/O 完成是一个动作,所以 slat 实际上就是 I/O 完成的时间
|
||||
- 异步顺序写测试命令
|
||||
```bash
|
||||
@@ -183,6 +183,6 @@ categories: ["storage"]
|
||||
sda: ios=0/262147, merge=0/1, ticks=0/6576, in_queue=6568, util=74.32%
|
||||
```
|
||||
|
||||
# 参考
|
||||
## 参考
|
||||
- [https://www.linuxidc.com/Linux/2019-08/160097.htm](https://www.linuxidc.com/Linux/2019-08/160097.htm)
|
||||
|
||||
|
Reference in New Issue
Block a user