我有两个连接到千兆交换机的
linux盒子.他们都有千兆网卡,电缆是cat7.
使用iperf测试网络显示快速连接,但使用rsync,scp或nfs共享传输文件的速度很慢.
我正在测试一个1GB的文件.
iperf结果:
Client connecting to odroid,TCP port 5001 TCP window size: 85.0 KByte (default) ------------------------------------------------------------ [ 3] local 192.168.1.26 port 58788 connected with 192.168.1.32 port 5001 [ ID] Interval Transfer Bandwidth [ 3] 0.0-10.0 sec 979 MBytes 821 Mbits/sec
rsync,scp或nfs的传输速度约为~13Mb / s
SCP:
scp bigfile odroid:/mnt/usb1/ [10:19:12] bigfile 57% 590MB 12.2MB/s 00:35 ETA^CKilled by signal 2.
rsync的:
rsync --progress bigfile /mnt/usb1/ bigfile 44,695,552 4% 12.15MB/s 0:01:11 ^C
NFS:
binaryplease➜~(master✗)» time cp bigfile /mnt/nfs/usb1/ cp -i bigfile /mnt/nfs/usb1/ 0.01s user 0.94s system 1% cpu 1:11.06 total
1024MB / 71sec = 14,42 MB / s
由于iperf测试显示了快速的网络连接,我认为存储设备的速度很慢,但似乎也不是这样:
客户端,SSD,内部:
binaryplease➜~(master✗)» sudo hdparm -tT /dev/sda /dev/sda: Timing cached reads: 20344 MB in 2.00 seconds = 10181.50 MB/sec Timing buffered disk reads: 1498 MB in 3.00 seconds = 498.98 MB/sec binaryplease➜~(master✗)» dd if=/dev/zero of=test oflag=direct bs=8M count=64 64+0 records in 64+0 records out 536870912 bytes (537 MB) copied,2.03861 s,263 MB/s binaryplease➜~(master✗)» dd if=test of=/dev/null iflag=direct bs=8M [12:29:01] 64+0 records in 64+0 records out 536870912 bytes (537 MB) copied,1.11392 s,482 MB/s
服务器,USB 3.0驱动器,外部:
➜ ~ git:(master) ✗ sudo hdparm -tT /dev/sda /dev/sda: Timing cached reads: 1980 MB in 2.00 seconds = 991.66 MB/sec Timing buffered disk reads: 266 MB in 3.01 seconds = 88.27 MB/sec ➜ usb1 dd if=/dev/zero of=test oflag=direct bs=8M count=64 64+0 records in 64+0 records out 536870912 bytes (537 MB) copied,6.53386 s,82.2 MB/s ➜ usb1 dd if=test of=/dev/null iflag=direct bs=8M 64+0 records in 64+0 records out 536870912 bytes (537 MB) copied,7.13567 s,75.2 MB/s
客户端操作系统(Linux arch):
Linux binaryplease-laptop 4.3.3-2-ARCH #1 SMP PREEMPT Wed Dec 23 20:09:18 CET 2015 x86_64 GNU/Linux
服务器上的操作系统(用于odroid的ubuntu服务器):
Linux odroid 3.10.92 #1 SMP PREEMPT Tue Nov 17 00:15:24 BRST 2015 armv7l armv7l armv7l GNU/Linux
在这两个系统上,cpu或ram都没有达到最大值.
如果我正确地解释了结果,服务器驱动器的写入速度(82.2 MB / s)应该很容易被网络匹配.文件传输速度如此之慢?
我希望提供的信息足够,有人可以帮我找到瓶颈.
谢谢.