我有一个通过 NFS 导出 ZFS 数据集的 FreeBSD 存储服务器,但小文件传输的性能低于可接受的限制。
一些背景资料:
我已经用fio测试了系统性能,始终使用以下参数:
fio --ioengine=posixaio --bs=4k --directory=/mountpoint --refill_buffers --iodepth=1 --file_service_type=sequential --create_on_open=1 --fallocate=0 --unlink=1 --name=benchmark1 --rw=randwrite --numjobs=1 --nrfiles=500000 --filesize=20KB
在服务器上本地测试显示写入速度约为55MB/s。
在 NFS 上测试相同的工作负载显示只有6000kB/s 的微不足道的性能。客户端的挂载选项如下:
myserver:/export/path on /mnt/tmp type nfs4 (rw,relatime,vers=4.1,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=clientip,local_lock=none,addr=serverip)
我还测试了单个大文件的顺序写入,以检查网络限制。对于这个工作负载,我得到 123MB/s,这是由于 NFS 客户端受千兆以太网限制。
我还测量了在 NFS (vfs.nfsd.async=1) 和 ZFS (zfs …