大网数据广告活动
服务器运维问答

Slow read and write speeds on FreeBSD ZFS

· 52CE 我爱测

my home storage server, which currently consists of 6 x 3 TB Seagate drives, 12 GB DDR3 RAM and a Core i3 540, has really poor performance when reading from or writing to the raidz2 I set up on. Using /usr/bin/time -h dd if=/dev/…

问题原文

原帖链接 · Tobias Timpe · CC BY-SA 3.0

my home storage server, which currently consists of 6 x 3 TB Seagate drives, 12 GB DDR3 RAM and a Core i3 540, has really poor performance when reading from or writing to the raidz2 I set up on.

Using /usr/bin/time -h dd if=/dev/zero of=sometestfile bs=1024 count=10:

10240 bytes transferred in 0.000221 secs (46331902 bytes/sec)

and the other way around:

10240 bytes transferred in 0.000107 secs (95656287 bytes/sec)

which translates to 46 MB/s write and 95 MB/s read speed. This seems kinda slow. Or is this perfectly normal?

Thanks

Tobias Timpe

已采纳解答

原帖链接 · Matt Simerson · CC BY-SA 3.0

With the command shown above, you aren't testing disk write performance. You're testing an assortment of factors but mostly controller and disk latency. To test disk read performance, you need to jump through hoops to exclude disk caching from your tests, which is non-trivial with ZFS as it means disabling the ARC cache. It's much easier to test write performance: write much larger files, preferably sizes exceeding your systems build-in RAM.

I ran this command on my home ZFS file server (Core i3-4130T with mirrored WDC WD80):

# /usr/bin/time -h dd if=/dev/zero of=sometestfile bs=1024 count=10000000
10240000000 bytes transferred in 55 secs (186900359 bytes/sec)

It's not great but that is a much better test of actual write performance. An interesting result is that I achieved 187MB/s and my disks rated performance is 178MB/s. That's a bit odd b/c typical benchmarks are some high fraction of rated performance. Exceeding it can be explained by ZFS's disk compression.

My disks are in a ZFS mirror (2x read performance is more useful to me than storage efficiency) but assuming your disks are also 5400 RPM, you should expect comparable write performance.

To see why even a much larger count using dd isn't a great test, check this out:

# /usr/bin/time -h dd if=/dev/zero of=sometestfile bs=1M count=1000000
1048576000000 bytes transferred in 223.56 secs (4690377542 bytes/sec)

Simply by increasing the blocksize to 1M, my disk performance is now off the charts amazing. Until you realize that reading from /dev/zero means the data source has no entropy and is highly compressible. dd is not the best tool for testing disk performance.

There are other tools in the FreeBSD ports tree (I've used bonnie & iozone in the past) which can tell you more information about your disks performance. If you're really curious, look into them. Otherwise, a MUCH better performance test for a home file server is to copy the contents of a DVD or blu-ray between two disks and time that copy.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-02-17)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。