使用intel NASPT工具测试samba读写文件性能

操作相对简单,只说明基本流程。

1.我们可以再http://software.intel.com/en-us/articles/intel-nas-performance-toolkit/获取NASPT的工具和相关介绍;

2.对于samba服务器设置权限,对于测试路径给予读写权限;

3.通过windows浏览samba地址后,建立网络映射路径;

4.此时就可以通过工具测试了,注意测试地址最少需要有80G的空间,测试目录最好为空。

 

测试速度与磁盘连接方式(如是通过SATA连接还是usb接口),磁盘格式(ext4 ,ntfs-3g挂载,ufsd挂载的),操作系统有关。

 

 

Making writes efficient on Linux(By:https://wiki.samba.org/index.php/Linux_Performance)

By default, when Samba receives these 1 byte "extension" write requests, it simply does a normal one-byte "sparse" write at the required position in the file. This is very fast, but only causes one file system block (the block "dirtied" by the one byte write) to be allocated. When the real data is finally written into the file, the blocks then have to be allocated for real on the file system. Because these blocks are not then allocated "in order" on the file system, as it were, these actual writes can be quite slow.

The most efficient way to allocate file system blocks when data is to be written into all of the file (for example, a streaming video write) is to allocate what is called an "extent" on the file system. The requested blocks are then laid out by the underlying file system (ext4 or XFS) in a very efficient way which causes the actual writes to be much faster than having to allocate them dynamically.

How does a Linux application (Samba) get access to this new extent-based allocation call ? Simple, it's built into glibc on modern Linux distributions via the posix_fallocate() call. In the new patch that has gone into Samba 3.5.7 (and also all future versions of Samba), when the smb.conf parameter:

"strict allocate = yes"

is set on a share, whenever a file is extended by an SMBwriteX/SMB2_WRITE call, call Samba calls posix_fallocate() to ensure the file extends to at least the size given as the offset in the SMBwriteX/SMB2_WRITE request, then does the actual write.

In tests done on an ext4 file system, changing to "strict allocate = yes" and using the posix_fallocate() call in this way increased the write performance of Samba by 2/3 on a NETGEAR ReadyNAS box as tested by the Intel NASPT test tool, available here:

http://software.intel.com/en-us/articles/intel-nas-performance-toolkit/

The specific tests used to measure the performance increase were the "File Copy to NAS" and the "HD Video Record" tests.

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值