You are not logged in.

#1 2015-05-01 10:57:12

sweetthdevil
Member
Registered: 2009-10-20
Posts: 415

Samba server config - Slow streaming video

Hi All,

I am turning to you guys, because after several weeks or trying to sort out the slow streaming from my arch desktop from samba share I am out of ideas.

The home setup -

Desktop:  Archlinux (Asus P5Q Turbo motherboard) - cabled connection
Router: Virgin Media SuperHub 2
Nas: GoFlex Home - running archlinux ARM - cabled connection

Now I have samba shares setup on both my desktop and my goflex (on same network) While accessing video files from either phone (LG G3) or tablet (Nexus 10) the videos load instantly from the NAS - however the videos from the desktop load slowing and keep stoping to buffer every 30 secondes or so.

Checking the smb.conf from the NAS, no tweaks were needed so no tweaks can be taken from there.

Please see below desktop smb.conf

Looking forward for your suggestion or hopefully solution.
Many thanks,

[global]
	workgroup = MYGROUP
	server string = Samba Server
	log file = /var/log/samba/%m.log
	max log size = 50
	dns proxy = No
	wins support = Yes
	idmap config * : backend = tdb
	valid users = sweetth
	admin users = sweetth
	read raw = yes
	write raw = yes
	strict locking = No
	socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=131072 SO_SNDBUF=131072
	oplocks = true 
	Read size = 16384

Offline

#2 2015-05-01 11:36:47

Buddlespit
Member
From: Chesapeake, Va.
Registered: 2014-02-07
Posts: 501

Re: Samba server config - Slow streaming video

If you're streaming, then samba has nothing to do with it.

Offline

#3 2015-05-01 11:41:58

sweetthdevil
Member
Registered: 2009-10-20
Posts: 415

Re: Samba server config - Slow streaming video

Thank you for your answer.

If samba has nothing to do with it then what has? And how to resolve the issue?

Offline

#4 2015-05-01 11:45:26

Buddlespit
Member
From: Chesapeake, Va.
Registered: 2014-02-07
Posts: 501

Re: Samba server config - Slow streaming video

I don't know what's installed on your NAS for streaming media. On my server, I'm using a highly modified version of MediaTomb. There are a few other servers out there, the one coming most readily to mind is Plex.

Offline

#5 2015-05-01 11:55:21

sweetthdevil
Member
Registered: 2009-10-20
Posts: 415

Re: Samba server config - Slow streaming video

I think there is been an misunderstanding. I connect to my desktop through samba share using ES File Explorer on my phone/tablet. Same principle on my Nas. However on my Nas I have minidlna running to allow my xbox one to read the files.

So unless I am mistaking it is samba which is at fault there.

Offline

#6 2015-05-01 12:04:50

Buddlespit
Member
From: Chesapeake, Va.
Registered: 2014-02-07
Posts: 501

Re: Samba server config - Slow streaming video

Ah, ok.... You aren't streaming, you're sharing. Have you checked the download rates/speeds between your NAS and wireless (tablet and phone) and you speeds between NAS and wired (desktop)? Also, your socket options seem a tad high. Have you tried lowering them to 65532 instead of 131072? I found that change to speed up my samba sharing from about 3-4 MB/s to 6-8 MB/s (still drops to 4-5 MB/s every now and again, depends on the format/compression of the file I'm moving) .

Offline

#7 2015-05-01 22:33:42

sweetthdevil
Member
Registered: 2009-10-20
Posts: 415

Re: Samba server config - Slow streaming video

Thanks again for the reply, just tried the suggested changed but it's still the same.

Any other suggestion?

Offline

#8 2015-05-02 11:37:48

Soukyuu
Member
Registered: 2014-04-08
Posts: 854

Re: Samba server config - Slow streaming video

I'm having decent speeds (~80MB/s) via my gigabit link with these settings, was much lower (~50MB/s) before, so give them a try:

socket options=SO_RCVBUF=131072 SO_SNDBUF=131072 IPTOS_LOWDELAY TCP_NODELAY
 min receivefile size = 16384
 use sendfile = true
 aio read size = 16384
 aio write size = 16384

[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]

Offline

#9 2015-05-02 11:49:16

Buddlespit
Member
From: Chesapeake, Va.
Registered: 2014-02-07
Posts: 501

Re: Samba server config - Slow streaming video

A good place to start for configuring and optimizing samba would be here: https://calomel.org/samba.html

Offline

#10 2015-05-02 23:01:53

sweetthdevil
Member
Registered: 2009-10-20
Posts: 415

Re: Samba server config - Slow streaming video

Thanks for the replies.

Tried the configs - that didn't change anything. download file at 330kb/s but uploading at 3.5mb/s

Also looked at calomel before but I have tried most and nothing works neither. Any other idea?

Offline

#11 2015-05-02 23:04:11

Buddlespit
Member
From: Chesapeake, Va.
Registered: 2014-02-07
Posts: 501

Re: Samba server config - Slow streaming video

Nope, all out of ideas..

Offline

#12 2015-05-02 23:07:58

sweetthdevil
Member
Registered: 2009-10-20
Posts: 415

Re: Samba server config - Slow streaming video

God that was a very quick reply!

Many thanks

Offline

#13 2015-05-02 23:43:26

Soukyuu
Member
Registered: 2014-04-08
Posts: 854

Re: Samba server config - Slow streaming video

Hmm that's weird really. If you were running windows (:P), I'd recommend looking at driver settings of your network card, especially the TCP offloading setting. No idea if there is something like that on linux.


[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]

Offline

#14 2015-05-02 23:44:53

sweetthdevil
Member
Registered: 2009-10-20
Posts: 415

Re: Samba server config - Slow streaming video

Well I have joined the samba mailing list and asked the question there. Hopefully will get it sorted.

Cheers

Offline

#15 2016-02-28 21:26:20

anthonytex
Member
Registered: 2016-02-28
Posts: 7

Re: Samba server config - Slow streaming video

sweetthdevil wrote:

Well I have joined the samba mailing list and asked the question there. Hopefully will get it sorted.

Cheers

Hello i know it's an old discussion and apologize for this but i have the same issue with both Arch and Debian and i was wondering if you have found a solution for this problem.
Thank you for your help

Offline

#16 2016-02-28 21:30:21

sweetthdevil
Member
Registered: 2009-10-20
Posts: 415

Re: Samba server config - Slow streaming video

Well yes the issue is sorted, my old trusted pc died and got replaced. Since then i do not have any issue and i think it was done to the network card being old and slow. Hope that help

Offline

#17 2016-02-28 21:45:47

anthonytex
Member
Registered: 2016-02-28
Posts: 7

Re: Samba server config - Slow streaming video

sweetthdevil wrote:

Well yes the issue is sorted, my old trusted pc died and got replaced. Since then i do not have any issue and i think it was done to the network card being old and slow. Hope that help

Thank you for your quick answer! ... So i have to kill my old pc!:P 
By the way the strange thing is this: if i  read the shared directory from a windows machine, and so Arch ---smb---> windows i get an average speed of 120MB/s. I also get the same speed by sending a file to Arch from windows and to Arch server from another linux machine. No idea.
BTW thank for your answer

Offline

#18 2016-03-01 20:44:30

anthonytex
Member
Registered: 2016-02-28
Posts: 7

Re: Samba server config - Slow streaming video

ohhh! found the solution!! after spend hours and near to buy a pci card i looked in an old bug report in linux tree where this Ethernet controller corrupt tcp/ip package of ipv6 protocol. After testing some patch with no results and also disabling ipv6 the idea: maybe the TSO of the card is broken also in the ipv4 connectivity and the answare is YES: disabling TCP segmentation offloading also for the ipv4 (the ipv6 was disabled in the driver years ago by linux developers ) fixes all problems of packets corruption. So for everbody that will look to this discussion this is the workaround:
First found the interface name with

ip addr | sed '/^[0-9]/!d;s/: <.*$//'

then check if the TSO is off with

ethtool -k yourcard 

My result was

Features for enp2s0:
rx-checksumming: off [fixed]
tx-checksumming: on
        tx-checksum-ipv4: off [fixed]
        tx-checksum-ip-generic: on
        tx-checksum-ipv6: off [fixed]
        tx-checksum-fcoe-crc: off [fixed]
        tx-checksum-sctp: off [fixed]
scatter-gather: on
        tx-scatter-gather: on
        tx-scatter-gather-fraglist: off [fixed]
tcp-segmentation-offload: on
        tx-tcp-segmentation: on
        tx-tcp-ecn-segmentation: off [fixed]
        tx-tcp6-segmentation: off [fixed]
udp-fragmentation-offload: off [fixed]
generic-segmentation-offload: on
generic-receive-offload: on
large-receive-offload: off [fixed]
rx-vlan-offload: on
tx-vlan-offload: on [fixed]
ntuple-filters: off [fixed]
receive-hashing: off [fixed]
highdma: off [fixed]
rx-vlan-filter: off [fixed]
vlan-challenged: off [fixed]
tx-lockless: on [fixed]
netns-local: off [fixed]
tx-gso-robust: off [fixed]
tx-fcoe-segmentation: off [fixed]
tx-gre-segmentation: off [fixed]
tx-ipip-segmentation: off [fixed]
tx-sit-segmentation: off [fixed]
tx-udp_tnl-segmentation: off [fixed]
fcoe-mtu: off [fixed]
tx-nocache-copy: off
loopback: off [fixed]
rx-fcs: off
rx-all: off
tx-vlan-stag-hw-insert: off [fixed]
rx-vlan-stag-hw-parse: off [fixed]
rx-vlan-stag-filter: off [fixed]
l2-fwd-offload: off [fixed]
busy-poll: off [fixed]

as you can see the ipv6 was turned off by linux developers years ago! Now disable completly with

 ethtool -K yourcard tso off 

now you should see

Features for enp2s0:
rx-checksumming: off [fixed]
tx-checksumming: on
        tx-checksum-ipv4: off [fixed]
        tx-checksum-ip-generic: on
        tx-checksum-ipv6: off [fixed]
        tx-checksum-fcoe-crc: off [fixed]
        tx-checksum-sctp: off [fixed]
scatter-gather: on
        tx-scatter-gather: on
        tx-scatter-gather-fraglist: off [fixed]
tcp-segmentation-offload: off
        tx-tcp-segmentation: off
        tx-tcp-ecn-segmentation: off [fixed]
        tx-tcp6-segmentation: off [fixed]
udp-fragmentation-offload: off [fixed]
generic-segmentation-offload: on
generic-receive-offload: on
large-receive-offload: off [fixed]
rx-vlan-offload: on
tx-vlan-offload: on [fixed]
ntuple-filters: off [fixed]
receive-hashing: off [fixed]
highdma: off [fixed]
rx-vlan-filter: off [fixed]
vlan-challenged: off [fixed]
tx-lockless: on [fixed]
netns-local: off [fixed]
tx-gso-robust: off [fixed]
tx-fcoe-segmentation: off [fixed]
tx-gre-segmentation: off [fixed]
tx-ipip-segmentation: off [fixed]
tx-sit-segmentation: off [fixed]
tx-udp_tnl-segmentation: off [fixed]
fcoe-mtu: off [fixed]
tx-nocache-copy: off
loopback: off [fixed]
rx-fcs: off
rx-all: off
tx-vlan-stag-hw-insert: off [fixed]
rx-vlan-stag-hw-parse: off [fixed]
rx-vlan-stag-filter: off [fixed]
l2-fwd-offload: off [fixed]
busy-poll: off [fixed]
 

Now every ploblem that causes packets to be resend are gone.
I've also send a bug report to bugzilla.kernel.org
Hope it helps wink

Offline

Board footer

Powered by FluxBB