---
title: "iozone测试glusterfs性能"
author: "lancelotwjq"
date: "2012-11-27T11:39:53Z"
tags: []
categories: ["开源软件"]
slug: "iozone-glusterfs"
draft: false
lastmod: "2012-11-27T17:16:16Z"
id: 1735852
url: "https://glusterfs.iteye.com/blog/1735852"
---

**iozone** 是linux下的磁盘性能测试工具，编译完成后就一个bin文件，用起来也很方便。

./iozone -a -n 1g -g 2g -i 0 -i 1 -i 2 -i 3 -i 7 -f /mnt/iozone -Rb no-rh.xls

**-a** 表示自动测试

**-n , -g** 表示最小和最大的文件大小

**-i** 代表测试项目

Used to specify which tests to run. (0=write/rewrite, 1=read/re-read, 2=random-read/write  
3=Read-backwards, 4=Re-write-record, 5=stride-read, 6=fwrite/re-fwrite, 7=fread/Re-fread,  
8=random mix, 9=pwrite/Re-pwrite, 10=pread/Re-pread, 11=pwritev/Re-pwritev, 12=preadv/Re-  
preadv).  
**One will always need to specify 0** so that any of the following tests will have a file to measure.  
\-i # -i # -i # is also supported so that one may select more than one test.

0是必须的。

**-Rb** 指定输出文件

\----------------------------------------------------------------------------------------------------

下面就使用iozone对glusterfs的性能做一个简单的测试。**iozone要求文件大小为内存的两倍，测试机器内存为8G，则文件大小设为16G。**

首先新建一个glusterfs卷，它使用了一个本地的brick。 这样没有网络，也没有副本拷贝，基本上是最简单的glusterfs卷了。

然后我关掉了io-cache, read-ahead, write-behind这些用于提高性能的xlator。关闭方法：

gluster volume set XXX off

将卷挂载到/mnt，开始测试....