为什么我的磁带驱动器这么慢?

为什么我的磁带驱动器这么慢?

我购买了一台二手 Quantum Ultrium LTO-4 磁带机,并将其连接到我的 HP ProLiant N54l 中的 HP Smart Array P400 SAS 控制器。我使用 FreeBSD 11 作为我的操作系统。

现在我插入了磁带并运行了 Baculabtape命令的基准测试:

$ btape /dev/nsa0
Tape block granularity is 1024 bytes.
btape: butil.c:291-0 Using device: "/dev/nsa0" for writing.
btape: btape.c:471-0 open device "LTO-4" (/dev/nsa0): OK
*rewind
btape: btape.c:576-0 Rewound "LTO-4" (/dev/nsa0)
*speed
btape: btape.c:1055-0 Test with zero data, should give the maximum throughput.
btape: btape.c:904-0 Begin writing 3 files of 1.073 GB with raw blocks of 64512 bytes.
++++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=1.073 GB. Write rate = 2.182 MB/s
+++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=1.073 GB. Write rate = 4.511 MB/s
+++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=1.073 GB. Write rate = 1.835 MB/s
btape: btape.c:379-0 Total Volume bytes=3.221 GB. Total Write rate = 2.449 MB/s

这项测试(以及其他一些测试)证实写入速度约为 2 MB/s,这太慢了。为什么会这样?我该怎么做才能将写入速度提高到预期速度(例如 100 MB/s)?

编辑

看来控制器可能出了问题。重新启动后,我能够高速传输数据一段时间,直到出现许多 PCI 错误,速度才慢下来:

ciss0: *** PCI-E LL correctable errors, count=10546, LLErrStatus=0x80000004
ciss0: *** PCI-E LL correctable errors, count=20570, LLErrStatus=0x80000004
ciss0: *** PCI-E LL correctable errors, count=30995, LLErrStatus=0x80000004
ciss0: *** PCI-E LL correctable errors, count=41101, LLErrStatus=0x80000004
ciss0: *** PCI-E LL correctable errors, count=51400, LLErrStatus=0x80000004
ciss0: *** PCI-E LL correctable errors, count=61729, LLErrStatus=0x80000004

可能是卡安装位置不正确或类似问题。

答案1

最小和最大读写速度取决于驱动器。LTO
-4 的最大未压缩速度为 120 MBps。Quantum
LTO-4 HH 磁带驱动器的压缩传输速率高达 576GB/小时(假设压缩率为 2:1)。
此驱动器的实际最大速度为:576GB/小时 /2 = 288 *1024MB / 3600s = 81.92MBps。根据驱动器规格:

数据速率匹配范围:33 至 80MB/秒原生

所以你永远无法达到 100 MB/s

编辑:
阅读使用 Bacula 测试你的磁带驱动器
您应该设置 bacula-sd.conf 文件,并确保 Bacula(存储守护进程)没有运行或者您已卸载将用于测试的驱动器。

答案2

我将 HP SmartArray P400 SAS 控制器换成了 LSI 3041E SAS 控制器。这解决了我的性能问题,现在我可以轻松地以高速备份(实际上我可以达到大约 70 MB/s)。下面是以前使用的相同性能测试的输出:

$ btape /dev/nsa0
Tape block granularity is 1024 bytes.
btape: butil.c:291-0 Using device: "/dev/nsa0" for writing.
btape: btape.c:471-0 open device "LTO-4" (/dev/nsa0): OK
*rewind
btape: btape.c:576-0 Rewound "LTO-4" (/dev/nsa0)
*speed
btape: btape.c:1055-0 Test with zero data, should give the maximum throughput.
btape: btape.c:904-0 Begin writing 3 files of 1.073 GB with raw blocks of 64512 bytes.
++++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=1.073 GB. Write rate = 71.58 MB/s
+++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=1.073 GB. Write rate = 119.3 MB/s
+++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=1.073 GB. Write rate = 134.2 MB/s
btape: btape.c:379-0 Total Volume bytes=3.221 GB. Total Write rate = 100.6 MB/s

btape: btape.c:904-0 Begin writing 3 files of 2.147 GB with raw blocks of 64512 bytes.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=2.147 GB. Write rate = 143.1 MB/s
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=2.147 GB. Write rate = 153.3 MB/s
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=2.147 GB. Write rate = 143.1 MB/s
btape: btape.c:379-0 Total Volume bytes=6.442 GB. Total Write rate = 146.4 MB/s

btape: btape.c:904-0 Begin writing 3 files of 4.294 GB with raw blocks of 64512 bytes.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=4.295 GB. Write rate = 165.1 MB/s
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=4.295 GB. Write rate = 165.1 MB/s
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=4.295 GB. Write rate = 165.1 MB/s
btape: btape.c:379-0 Total Volume bytes=12.88 GB. Total Write rate = 165.1 MB/s

btape: btape.c:1067-0 Test with random data, should give the minimum throughput.
btape: btape.c:904-0 Begin writing 3 files of 1.073 GB with raw blocks of 64512 bytes.
++++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=1.073 GB. Write rate = 53.69 MB/s
+++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=1.073 GB. Write rate = 51.13 MB/s
+++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=1.073 GB. Write rate = 53.69 MB/s
btape: btape.c:379-0 Total Volume bytes=3.221 GB. Total Write rate = 52.80 MB/s

btape: btape.c:904-0 Begin writing 3 files of 2.147 GB with raw blocks of 64512 bytes.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=2.147 GB. Write rate = 59.65 MB/s
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=2.147 GB. Write rate = 58.04 MB/s
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=2.147 GB. Write rate = 58.04 MB/s
btape: btape.c:379-0 Total Volume bytes=6.442 GB. Total Write rate = 58.56 MB/s

btape: btape.c:904-0 Begin writing 3 files of 4.294 GB with raw blocks of 64512 bytes.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=4.295 GB. Write rate = 60.49 MB/s
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=4.295 GB. Write rate = 70.41 MB/s
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=4.295 GB. Write rate = 69.27 MB/s
btape: btape.c:379-0 Total Volume bytes=12.88 GB. Total Write rate = 66.41 MB/s

btape: btape.c:1081-0 Test with zero data and bacula block structure.
btape: btape.c:959-0 Begin writing 3 files of 1.073 GB with blocks of 64512 bytes.
+++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=1.073 GB. Write rate = 71.58 MB/s
+++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=1.073 GB. Write rate = 76.70 MB/s
+++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=1.073 GB. Write rate = 71.58 MB/s
btape: btape.c:379-0 Total Volume bytes=3.221 GB. Total Write rate = 73.21 MB/s

btape: btape.c:959-0 Begin writing 3 files of 2.147 GB with blocks of 64512 bytes.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=2.147 GB. Write rate = 93.37 MB/s
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=2.147 GB. Write rate = 85.90 MB/s
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=2.147 GB. Write rate = 89.48 MB/s
btape: btape.c:379-0 Total Volume bytes=6.442 GB. Total Write rate = 89.48 MB/s

btape: btape.c:959-0 Begin writing 3 files of 4.294 GB with blocks of 64512 bytes.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=4.295 GB. Write rate = 97.61 MB/s
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=4.295 GB. Write rate = 99.88 MB/s
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=4.295 GB. Write rate = 97.61 MB/s
btape: btape.c:379-0 Total Volume bytes=12.88 GB. Total Write rate = 98.35 MB/s

btape: btape.c:1093-0 Test with random data, should give the minimum throughput.
btape: btape.c:959-0 Begin writing 3 files of 1.073 GB with blocks of 64512 bytes.
+++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=1.073 GB. Write rate = 41.30 MB/s
+++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=1.073 GB. Write rate = 39.77 MB/s
+++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=1.073 GB. Write rate = 41.30 MB/s
btape: btape.c:379-0 Total Volume bytes=3.221 GB. Total Write rate = 40.77 MB/s

btape: btape.c:959-0 Begin writing 3 files of 2.147 GB with blocks of 64512 bytes.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=2.147 GB. Write rate = 45.69 MB/s
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=2.147 GB. Write rate = 44.74 MB/s
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=2.147 GB. Write rate = 44.74 MB/s
btape: btape.c:379-0 Total Volume bytes=6.442 GB. Total Write rate = 45.05 MB/s

btape: btape.c:959-0 Begin writing 3 files of 4.294 GB with blocks of 64512 bytes.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=4.295 GB. Write rate = 45.69 MB/s
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=4.295 GB. Write rate = 49.94 MB/s
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
btape: btape.c:606-0 Wrote 1 EOF to "LTO-4" (/dev/nsa0)
btape: btape.c:405-0 Volume bytes=4.295 GB. Write rate = 51.13 MB/s
btape: btape.c:379-0 Total Volume bytes=12.88 GB. Total Write rate = 48.80 MB/s

*quit

我非常确定这一系列 SAS 控制器一般不喜欢磁带驱动器,正如我执行的以下测试所证明的那样:

  • 我把 SmartArray P400 换成了另一个相同类型的控制器,结果相同,但没有PCI-E LL correctable errors
  • 我换了另一条电缆,结果还是一样。
  • 我将硬盘驱动器连接到 SmartArray P400 卡,它运行正常。

相关内容