EA8500 FTP, SMB performance (SATA HDD)

Hi.
I have a 6 TB SATA HDD with the ext4 filesystem connected to Linksys EA8500 router by the eSATA interface.
I've tested HDD speed by dd, and obtained these results:

root@OpenWrt:~# time dd if=/dev/zero of=/mnt/D/test1.img bs=100M count=128
128+0 records in
128+0 records out
real    1m 53.52s
user    0m 0.01s
sys     1m 43.84s
root@OpenWrt:~# time dd if=/mnt/D/test1.img of=/dev/null bs=100M count=128
128+0 records in
128+0 records out
real    1m 20.85s
user    0m 0.00s
sys     0m 40.51s

After calculations, I've obtained a write speed of 112 MB/s and a read speed of 158 MB/s which is OK for this HDD.
But the speed of reading and writing files by the FTP protocol (vsftpd server) and SMB (ksmbd) are much lower:
FTP: read speed 30 MB/s, write speed 58 MB/s.
SMB: read speed 28 MB/s, write speed 55 MB/s.
From output of top: near 49% sys load, near 20% sirq load.
Why such a drop in speed occurs? Is my router's 2-cores CPU by 1.4 GHz each (IPQ8064) is to slow for quick FTP or SMB transfers?

  1. Those CPU's of embedded network devices are not made for file operations.
  2. Protocol matters. SMB is a different protocol as FTP. SMB is made for filesharing and while FTP is made for file transfer.
  3. Test method matters. DD has almost no "overhead" and is constantly writing plain zeros to the device. If you copy a file over SMB/FTP it is (probably) not filled by zeros.
  4. Underlaying filesystem matters also. Writing just zeros is less work then writing a "normal" file (journaling, checksumming, etc.).
  5. You probably mixed up read and write speeds in your post. Write speed is usually always slower then read.
  6. Nonetheless your values looking a bit low (to me) and I would expect ~80MB/s for reading. BUT: Make sure your system pushing the data over LAN to/from is not the bottleneck AND verify that you are not meassuring the wrong site of the end. Are the values for SMB/FTP taken from Windows filetransfer overview? You cannot compare values generated on the router itself (dd) with "real"/practial values involving client and server.
2 Likes
  1. Yes, I understand that...
  2. I've tried both because I thought that SMB may be more resource-demanding that FTP.
  3. Yes, I understand. SATA port in this router is interesting for me as port for building small home NAS, thats it is more appropriate to measure speed with real files with non-zeros content.
  4. Yes...
  5. No, write speed definitely is more than read speed. Yes, this look really strange for me too...
  6. I will try to measure connection speed between router and PC by using the iperf utility, but this PC can transfer data by 1GBe without any significant load on the system (I5-2500).

I just can guess what the reason is for this. Something is definetly wrong if write speed is higher then read speed. So I would first try stock firmware to verify it is not an OS/driver related issue. Or try USB3 if available/possible on this router/harddrive to crosscheck if SATA port/cable is working correct..

I can't try stock firmware now, maybe later.
I've tried to do some benchmarks with USB3 UASP SSD and I obtained the same results: write to SSD by SMB/FTP near 60 MB/s, read from SSD by FTP/SMB near 30 MB/s...