问题:
我在千兆网络上将文件从连接到 SOC 的外部机箱传输到 PC 的 SSD 时,速度只有约 30MB/s。我本以为传输速度会更快。我使用的是 FTPES,也尝试过 SCP,两者的速度上限都在 30MB/s 左右
背景:
我有一台 SOC(Odroid XU4),配有千兆以太网网卡和 USB 3.0 集线器。它连接到千兆以太网管理交换机(Cisco sg200-08),后者连接到千兆以太网路由器(Netgear R8000),我的电脑连接到该路由器(也配有千兆网卡)。
设备:
SOC: Odroid XU4
External Disks: 4TB 5400 RPM
Switch: Cisco sg200-08
Router: Netgear R8000
Computer: Custom build with gigabit ethernet
图表:
SOC -> Gigabit Switch -> Gigabit Router -> Gigabit NIC pc
现在我测试了从 SOC 到磁盘的读取速度:
kevin@ftpbox:~$ sudo hdparm -Tt /dev/sda
/dev/sda:
Timing cached reads: 2008 MB in 2.00 seconds = 1005.91 MB/sec
Timing buffered disk reads: 364 MB in 3.00 seconds = 121.21 MB/sec
kevin@ftpbox:~$ sudo hdparm -Tt /dev/sdb'
> ^C
kevin@ftpbox:~$ sudo hdparm -Tt /dev/sdb
/dev/sdb:
Timing cached reads: 2004 MB in 2.00 seconds = 1003.25 MB/sec
Timing buffered disk reads: 394 MB in 3.01 seconds = 130.74 MB/sec
kevin@ftpbox:~$ sudo hdparm -Tt /dev/sdc
/dev/sdc:
Timing cached reads: 2008 MB in 2.00 seconds = 1005.80 MB/sec
Timing buffered disk reads: 394 MB in 3.01 seconds = 130.83 MB/sec
kevin@ftpbox:~$ sudo hdparm -Tt /dev/sdd
/dev/sdd:
Timing cached reads: 1982 MB in 2.00 seconds = 992.31 MB/sec
Timing buffered disk reads: 394 MB in 3.01 seconds = 130.83 MB/sec
我也尝试过从两台不同的机器上执行 iperf,我的电脑运行 Windows,我的路由器运行 dd-wrt 到我的 SOC
PC 至 SOC:
kevin@ftpbox:~$ iperf -c 192.168.1.2 -p 5201
------------------------------------------------------------
Client connecting to 192.168.1.2, TCP port 5201
TCP window size: 20.0 KByte (default)
------------------------------------------------------------
[ 3] local 192.168.1.22 port 47193 connected with 192.168.1.2 port 5201
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 0.00 (null)s 2350133821636822 Bytes/sec
kevin@ftpbox:~$ iperf -c 192.168.1.2 -p 5201
------------------------------------------------------------
Client connecting to 192.168.1.2, TCP port 5201
TCP window size: 20.0 KByte (default)
------------------------------------------------------------
[ 3] local 192.168.1.22 port 47194 connected with 192.168.1.2 port 5201
^C[ ID] Interval Transfer Bandwidth
[ 3] 0.0- 2.1 sec 0.00 (null)s 2354598378962423 Bytes/sec
kevin@ftpbox:~$ iperf -s
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[ 4] local 192.168.1.22 port 5001 connected with 192.168.1.2 port 63008
[ ID] Interval Transfer Bandwidth
[ 4] 0.0-20.2 sec 14.0 Bytes 5.55 bits/sec
我从路由器获得的结果与 SOC 类似
路由器到 SOC:
kevin@ftpbox:~$ iperf -c 192.168.1.1 -p 5201
------------------------------------------------------------
Client connecting to 192.168.1.1, TCP port 5201
TCP window size: 20.0 KByte (default)
------------------------------------------------------------
[ 3] local 192.168.1.22 port 58115 connected with 192.168.1.1 port 5201
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 0.00 (null)s 2350254378773930 Bytes/sec
kevin@ftpbox:~$ iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[ 4] local 192.168.1.22 port 5001 connected with 192.168.1.1 port 55060
[ ID] Interval Transfer Bandwidth
[ 4] 0.0-64.8 sec 14.0 Bytes 1.73 bits/sec
以下是 ifconfig 对适配器的说明:
kevin@ftpbox:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:1e:06:31:a6:81
inet addr:192.168.1.22 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::21e:6ff:fe31:a681/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5592 errors:0 dropped:4 overruns:0 frame:0
TX packets:3022 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:855874 (855.8 KB) TX bytes:433684 (433.6 KB)
这是我的 SOC 适配器功能:
kevin@ftpbox:~$ ethtool eth0
Settings for eth0:
Supported ports: [ MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Link partner advertised pause frame use: No
Link partner advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: MII
PHYAD: 32
Transceiver: internal
Auto-negotiation: on
Cannot get wake-on-lan settings: Operation not permitted
Current message level: 0x00007fff (32767)
drv probe link timer ifdown ifup rx_err tx_err tx_queued intr tx_done rx_status pktdata hw wol
Link detected: yes
速度这么低是怎么回事?我应该检查什么?有什么想法吗?
答案1
答案如下:
我应该提到我正在使用采用 tls 的 vsftpd。我启用了 cipher=HIGH 标志。这导致 SOC 上的 CPU 崩溃。我在 vsftpd 上禁用了 ssl,但速度达到 70MB/s