I want to set up a NAS which I have done most recently with a Raspberry Pi 2 (quad-core ARM Cortex-A7, 1GB RAM, 32GB microSD) running Raspbian “Jessie”:
- I have a laptop—an HP Pavilion G6—running Ubuntu 14.04 and using 802.11b/g/n.
- I have an external USB 2.0 NTFS hard drive connected to a Raspberry Pi 2, using Samba and Apache, connected to the LAN of my wireless router at 100Mbps.
- When I try to transfer a file using Samba SMB from the Raspberry Pi 2, I get transfer rates at less than 1Mib/s.
- When I transfer a file using HTTP from the Raspberry Pi 2, I get a typical transfer rate of around 3-4Mib/s [better, but still pretty slow].
- When I transfer a file using FTP from the Raspberry Pi 2, I get a typical transfer rate of around 2-4Mib/s [better, but not as good as HTTP].
Why is it that transferring file using Samba SMB would transfer slower [3-4 times] than the same file using HTTP?
I don’t expect 10-12Mib/s—although close to it would be nice—from my local network as there are limitations with the network speed being at 100Mbs, connecting being USB 2.0 and Wi-Fi limitations, but at least it should be better than the Internet which has all these bottlenecks plus whatever else is outside.
Could it be a Samba configuration issue?
Test results [1.5Gb file transfer rates]:
USB 3.0: 70-80MiB/s
Only USB.
USB3.0 external hard drive connected to the USB3.0 port of the HP Pavilion G6 laptop.
File transferred with Dolphin file manager.
source: USB3.0 hard drive
destination: HP Pavilion G6 laptop
USB 2.0: 20-30MiB/s
Only USB.
USB3.0 external hard drive connected to the USB2.0 port of the Raspberry Pi.
File tested using pv
raspberry~$ pv source > destination
.Ethernet LAN: 8-9MiB/s
Wired.
USB3.0 external hard drive connected to the USB2.0 port of the Raspberry Pi.
HP Pavilion G6 laptop connected to network via Ethernet LAN.
File transferred using samba
smb://
.source: USB3.0 hard drive
destination: HP Pavilion G6 laptop
Internet file: 2-3MiB/s
Wi-Fi.
HTTP Wi-Fi LAN speed: 3-4MiB/s
Wi-Fi.
USB3.0 external hard drive connected to the USB2.0 port of the Raspberry Pi.
HP Pavilion G6 laptop connected to network via 802.11b/g/n Wi-Fi.
File on apache webserver
http://
.source: USB3.0 hard drive
destination: HP Pavilion G6 laptop
NFS Wi-Fi LAN speed: 3-4MiB/s
Wi-Fi.
USB3.0 external hard drive connected to the USB2.0 port of the Raspberry Pi.
HP Pavilion G6 laptop connected to network via 802.11b/g/n Wi-Fi.
File transferred with Dolphin file manager.
source: USB3.0 hard drive
destination: HP Pavilion G6 laptop
FTP Wi-Fi LAN speed: 2-4MiB/s
Wi-Fi.
USB3.0 external hard drive connected to the USB2.0 port of the Raspberry Pi.
HP Pavilion G6 laptop connected to network via 802.11b/g/n Wi-Fi.
File on vsftp server
ftp://
.source: USB3.0 hard drive
destination: HP Pavilion G6 laptop
SMB Wi-Fi LAN speed: < 900KiB/s
Wi-Fi.
USB3.0 external hard drive connected to the USB2.0 port of the Raspberry Pi.
HP Pavilion G6 laptop connected to network via 802.11b/g/n Wi-Fi.
File transferred using samba
smb://
.source: USB3.0 hard drive
destination: HP Pavilion G6 laptop
How can I improve this?
Here is the output of iwconfig
on my laptop:
wlan0 IEEE 802.11bgn ESSID:"Irk"
Mode:Managed Frequency:2.412 GHz Access Point: 34:31:C4:02:46:2D
Bit Rate=65 Mb/s Tx-Power=20 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Power Management:off
Link Quality=63/70 Signal level=-47 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:1369 Invalid misc:12350 Missed beacon:0
Here is info on my Raspberry Pi’s network connection via, dmesg | grep eth0
:
smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1