Iozone: NFS文件系统性能测试
2010-02-10 13:42
363 查看
使用IOZone测试,存在如下问题:
When I use the parameter -U, it failed.
The command is as follows:
/opt/ –azcR -U /mnt/foo –f /mnt/foo/testfile –b exceloutput.xls
"/mnt/foo" is a mounted directory, and “/opt/iozone/bin/iozone” is a local directory.
This command just executed once, and then prompts:
"umount: /mnt/foo: not mounted "
I found the "exceloutput.xls" just has one column measured data.
解决方法:
打开/etc/fstab 在其中追加如下:
192.168.21.201:/tmp /mnt/foo nfs defaults 0 0
关于这个文件的详细解释可参见:/etc/fstab文件解读:http://tagche.blog.51cto.com/649757/170699
这样做的好处是:
1)只需要 mount /mnt/foo即可,不需要 mount 192.168.21.201:/tmp /mnt/foo
2) 写进去后,重启机器,就自动挂载好了。当然你的nfs服务得启动。init5模式会正常启动,但init3不行,连network service都没启动。
3)注意如果fstab文件里面写的是/mnt/foo/,mount /mnt/foo会失败,但mount /mnt/foo/会成功。如果fstab写成/mnt/foo,两者均能成功。
这样的话,iozone umount完/mnt/foo,再重新mount /mnt/foo时就不会失败了。
最终的命令是这样的:
./iozone -az -g 4G -U /mnt/foo -f /mnt/foo/testfile -Rb /tmp/zhxue/URazbg4
注意:如果写成-U /mnt/foo/也会出错的:"umount: /mnt/foo: not mounted "
还是有问题,还没试下面的方法:
http://www.idcnews.net/html/edu/20080101/282828.html
I modify the source file, and recompile it using the command: make linux, and then use the following command to test.
In source file iozone.c , I modify the purge_buffer_cache
/************************************************************************/
/* Routine to purge the buffer cache by unmounting drive. */
/************************************************************************/
#ifdef HAVE_ANSIC_C
void
purge_buffer_cache()
#else
purge_buffer_cache()
#endif
{
char command[1024];
int ret,i;
strcpy(command,"umount ");
strcat(command, mountname);
/*
umount might fail if the device is still busy, so
retry unmounting several times with increasing delays
*/
for (i = 1; i < 10; ++i) {
ret = system(command);
if (ret == 0)
break;
sleep(i); /* seconds */
}
strcpy(command,"mount ");
strcat(command, mountname);
/*
mount might fail if the device is still busy, so
retry mounting several times with increasing delays
added by Zhenghua
*/
for (i = 1; i < 10; ++i) {
ret = system(command);
if (ret == 0)
break;
sleep(i); /* seconds */
}
}
In source file fileop.c, I modify the purge_buffer_cache
************************************************************************/
/* Routine to purge the buffer cache by unmounting drive. */
/************************************************************************/
void purge_buffer_cache()
{
if (!mountname)
return;
char cwd[PATH_MAX];
char command[1024];
int ret,i;
getcwd(cwd, sizeof(cwd));
chdir("/");
strcpy(command,"umount ");
strcat(command, mountname);
/*
umount might fail if the device is still busy, so
retry unmounting several times with increasing delays
*/
for (i = 1; i < 10; ++i) {
ret = system(command);
if (ret == 0)
break;
sleep(i); // seconds
}
strcpy(command,"mount ");
strcat(command, mountname);
/*
mount might fail if the device is still busy, so
retry mounting several times with increasing delays
added by zhenghua
*/
for (i = 1; i < 10; ++i) {
ret = system(command);
if (ret == 0)
break;
sleep(i); /* seconds */
}
chdir(cwd);
}
It turns out fine.
IOZone has accepted my modification, and join my contribution to the source code.终于为开源软件做了点贡献。
以前没注意到,当测试文件大小小于内存大小时,看不到磁盘的IO性能,因为充分利用了buffer和cache,所以性能极高。今天用下面命令重新测试了一下:
iozone -Rab /root/Desktop/testfs/Rb32 -n 16G -g 32G -y 64K -q 1M -i 0 -i 1
-n和-g控制自动模式(-a)下,待测文件的大小范围;
-y和-q控制自动模式下, record的大小范围;
When I use the parameter -U, it failed.
The command is as follows:
/opt/ –azcR -U /mnt/foo –f /mnt/foo/testfile –b exceloutput.xls
"/mnt/foo" is a mounted directory, and “/opt/iozone/bin/iozone” is a local directory.
This command just executed once, and then prompts:
"umount: /mnt/foo: not mounted "
I found the "exceloutput.xls" just has one column measured data.
解决方法:
打开/etc/fstab 在其中追加如下:
192.168.21.201:/tmp /mnt/foo nfs defaults 0 0
关于这个文件的详细解释可参见:/etc/fstab文件解读:http://tagche.blog.51cto.com/649757/170699
这样做的好处是:
1)只需要 mount /mnt/foo即可,不需要 mount 192.168.21.201:/tmp /mnt/foo
2) 写进去后,重启机器,就自动挂载好了。当然你的nfs服务得启动。init5模式会正常启动,但init3不行,连network service都没启动。
3)注意如果fstab文件里面写的是/mnt/foo/,mount /mnt/foo会失败,但mount /mnt/foo/会成功。如果fstab写成/mnt/foo,两者均能成功。
这样的话,iozone umount完/mnt/foo,再重新mount /mnt/foo时就不会失败了。
最终的命令是这样的:
./iozone -az -g 4G -U /mnt/foo -f /mnt/foo/testfile -Rb /tmp/zhxue/URazbg4
注意:如果写成-U /mnt/foo/也会出错的:"umount: /mnt/foo: not mounted "
还是有问题,还没试下面的方法:
http://www.idcnews.net/html/edu/20080101/282828.html
I modify the source file, and recompile it using the command: make linux, and then use the following command to test.
In source file iozone.c , I modify the purge_buffer_cache
/************************************************************************/
/* Routine to purge the buffer cache by unmounting drive. */
/************************************************************************/
#ifdef HAVE_ANSIC_C
void
purge_buffer_cache()
#else
purge_buffer_cache()
#endif
{
char command[1024];
int ret,i;
strcpy(command,"umount ");
strcat(command, mountname);
/*
umount might fail if the device is still busy, so
retry unmounting several times with increasing delays
*/
for (i = 1; i < 10; ++i) {
ret = system(command);
if (ret == 0)
break;
sleep(i); /* seconds */
}
strcpy(command,"mount ");
strcat(command, mountname);
/*
mount might fail if the device is still busy, so
retry mounting several times with increasing delays
added by Zhenghua
*/
for (i = 1; i < 10; ++i) {
ret = system(command);
if (ret == 0)
break;
sleep(i); /* seconds */
}
}
In source file fileop.c, I modify the purge_buffer_cache
************************************************************************/
/* Routine to purge the buffer cache by unmounting drive. */
/************************************************************************/
void purge_buffer_cache()
{
if (!mountname)
return;
char cwd[PATH_MAX];
char command[1024];
int ret,i;
getcwd(cwd, sizeof(cwd));
chdir("/");
strcpy(command,"umount ");
strcat(command, mountname);
/*
umount might fail if the device is still busy, so
retry unmounting several times with increasing delays
*/
for (i = 1; i < 10; ++i) {
ret = system(command);
if (ret == 0)
break;
sleep(i); // seconds
}
strcpy(command,"mount ");
strcat(command, mountname);
/*
mount might fail if the device is still busy, so
retry mounting several times with increasing delays
added by zhenghua
*/
for (i = 1; i < 10; ++i) {
ret = system(command);
if (ret == 0)
break;
sleep(i); /* seconds */
}
chdir(cwd);
}
It turns out fine.
IOZone has accepted my modification, and join my contribution to the source code.终于为开源软件做了点贡献。
以前没注意到,当测试文件大小小于内存大小时,看不到磁盘的IO性能,因为充分利用了buffer和cache,所以性能极高。今天用下面命令重新测试了一下:
iozone -Rab /root/Desktop/testfs/Rb32 -n 16G -g 32G -y 64K -q 1M -i 0 -i 1
-n和-g控制自动模式(-a)下,待测文件的大小范围;
-y和-q控制自动模式下, record的大小范围;
相关文章推荐
- 文件系统性能测试:使用iozone
- Iozone 文件系统的读写性能测试工具的使用
- Linux文件系统性能测试工具fdtree和iozone
- Vagrant共享目录文件系统sshfs、nfs、vboxfs、native fs性能比较测试
- Linux下文件系统的性能测试工具iozone
- iozone测试文件系统性能
- iozone文件系统性能测试工具
- 文件系统性能测试:使用iozone
- iozone测试文件系统
- OpenWrt中对USB文件系统的操作, 以及读写性能测试
- Iometer测试集群文件系统性能
- Linux - 两个Linux文件系统性能测试工具
- 开启 NFS 文件系统提升 Vagrant 共享目录的性能
- GlusterFS分布式集群文件系统安装、配置及性能测试
- 通过Nginx访问FastDFS文件系统并进行图片文件裁剪的性能测试和分析
- 【转】iozone 测试文件系统
- 文件系统,磁盘性能测试
- goofys和s3fs利用Minio,挂载到本地进行文件系统各个接口性能测试
- Linux下各种主要文件系统的读写性能测试 ------------实际系统中的Nand Flash速度测试结果
- Ext2、Ext3、Jfs、Xfs、Reiserfs文件系统性能大测试