Samba (NTFS) + optionally miniDLNA performance impact on BTHH5A

Hello. I have 30mbps VDSL coming to my BTHH5A which is running OpenWrt 19.0, and a Raspberry Pi 3 running OSMC and functioning as a media box.

I was using an Asus RT66AC running a thirdparty firmware as bSamba server with an external portable USB NTFS disk (so that I can mount it on both my PC and the RPi) and also as miniDLNA server .

Now that this router seems to be coming too the end of its life, I am going to remove it off the network. I have 2 options: to connect the disk to BTHH5A or the RPi3.

I know it makes sense to connect the disk to the RPi, but it crashes sometimes, and I don't want that to corrupt the data on the USB disk, so I am considering connecting the disk to the BTHH5A and serving Samba and hopefully mi niDLNA from there.

Do you think the BTHH5A can serve that without affecting its performance as modem-router? It's not currently doing running anything other than out-of-the-box OpenWrt, expect that I might want to install some bandwidth monitoring tool.

Thanks.

Personally I would avoid that. But if you insist, it's trial and error. See if the extra load will affect the stability and performance of the router.

1 Like

(Note: the performance fix from https://bugs.openwrt.org/index.php?do=details&task_id=2573 has not been applied)

I think you will not be happy with samba performance of the HomeHub. I have one, so here is a benchmark of the kernel-based solution (ksmbd-server).

First of all, let me test the USB2 performance without any samba server involved.

pv < /dev/sda > /dev/null

The result is 29.1MiB/s, with ~40% idle CPU. Similar performance is achieved for reading files from ext4.

Then I installed luci-app-ksmbd, and shared the mount point without any performance tuning. Then I mounted it on my Linux desktop as follows:

mount -t cifs -o rw,nosuid,nodev,guest,vers=2.0,cache=loose,nounix,uid=1000,gid=1000 //192.168.1.1/sda1 /mnt/cifs

The pv-based benchmark over a wired LAN yields only 4.86MiB/s then, with 34% idle CPU, which is well below any expectations. That's even not enough for some BluRay rips.

With ntfs-3g, the raw speed of reading files from the USB disk is only 22.4MiB/s, and over samba, this is still 4.46 MiB/s.

NFS is even slower (3.75MiB/s from ntfs-3g).

In other words, I don't think that the question "will samba impact routing performance" makes sense at all. You simply don't want such a slow samba server.

2 Likes

Anyway did a bit more testing to answer your question.

It appears that routing tasks have higher priority than the samba server. It is still possible to achieve 80 Mbit/s of internet bandwidth while a file is being transferred over cifs, it's just that the cifs transfer speed slows down to something like 1.5 MiB/s.

And to get the maximum performance out of your HomeHub as a file server, these tweaks are necessary:

  • Use ext4 filesystem
  • Disable packet steering. That is, in /etc/config/network:
config globals 'globals'
	option default_ps 0
  • Add some iptables rules that remove connection tracking for NFS and CIFS, in /etc/firewall.user:
iptables -t raw -A PREROUTING -d 192.168.1.1/32 -i br-lan -p tcp -m multiport --dports 445,2049 -j CT --notrack
iptables -t raw -A OUTPUT -s 192.168.1.1/32 -o br-lan -p tcp -m multiport --sports 445,2049 -j CT --notrack
iptables -I INPUT 1 -d 192.168.1.1/32 -i br-lan -p tcp -m multiport --dports 445,2049 -j ACCEPT
iptables -I OUTPUT 1 -s 192.168.1.1/32 -o br-lan -p tcp -m multiport --sports 445,2049 -j ACCEPT

With these tweaks, cifs can reach 5.82 MiB/s when there is no other traffic.

2 Likes

Many thanks. Yes, that was what I meant. I mean having a slow file server is bad, but having it affecting the main function of the router is even worse, so glad to know it's at least not that bad.

Though with the numbers for Samba I think I will make it my plan B in case the RPi 3 causes me much trouble until I get better hardware. (NFS isn't convenient for my operating systems) .

Thanks again for the answer and the tests--much appreciated.

Everything depends on the goal. If you have Router running DLNA server, Netflix and Youtube subscriptions with the right to download content plus several devices, smartTV, phones, tablets which can serve as DLNA players the storage attached to the Home hub is the best storage solution by my opinion.
The actual transfer speed requirements are not so high: Netflix asks only 5Mbytes/s to play HD. Even Google demands only 35 Mb /sec for the future Stadia platform in 4k according to the test which Google provides. The media server and File server are different things with different requirements.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.