Why Are SMB File Transfers Slow Over A VPN?

Why Are SMB File Transfers Slow Over A VPN?

Lawrence Systems

1 год назад

30,369 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@june5646
@june5646 - 27.12.2022 22:35

Thats why ya use WebDAV !

Ответить
@MrMcp76
@MrMcp76 - 27.12.2022 22:36

Any traffic that has to traverse the firewall is going to have a bad day with latency, especially SMB and VPN connections.

Keep it on the switch as much as you can.

VPNs are for security, really, not speed. If you want speed setup a virtual desktop you can remote into.

Great video!

Ответить
@willblanton3120
@willblanton3120 - 27.12.2022 23:05

To clarify this, it’s not related directly to SMB, but rather the TCP transport layer. Because of the error/congestion correction in TCP, there is something called a window. This means that the client and server agree that X number of bytes will be sent before an the sender waits for the acknowledgment that all packets were received. There is also a feature that’s called window scaling which changes the size of that window based on the connection and can drastically affect your transfer speeds.

What’s happening here is that the higher latency is forcing the TCP window scaling to decrease, making the window smaller and therefore throttling the transfer speeds. So even if you have a tunnel with a full gig connection on both ends, this additional latency could mean your throughput is actually limited to something similar to a 100Mbps connection.

A couple work arounds are to play with your operating system to find if there are methods that could affect the window scaling to allow for high speed but high latency connections, but I’ve found this to be pretty tricky, especially on Windows machines. The other option is to run multiple streams whenever possible, because each stream will have its own window. But this obviously relies on the application implemented supporting that, which is another issue entirely.

Ответить
@CoreyThompson73
@CoreyThompson73 - 27.12.2022 23:43

If you want to optimize SMB over a VPN, make sure all your node types are "p-nodes", so they don't waste efforts on broadcast traffic, like b-, h-, and m- type node use.

Ответить
@JasonGranzow
@JasonGranzow - 28.12.2022 00:38

I’ve been trying to explain this to people who insist on using SMB to send data to the other side of the world over a VPN. Thank you for the video. When they ask why we shouldn’t use SMB, I’m just going to send them a link to this video.

Ответить
@user-xv1vm5xc1f
@user-xv1vm5xc1f - 28.12.2022 00:57

Perfect timing

Ответить
@cpuuk
@cpuuk - 28.12.2022 01:07

Come back kermit, all is forgiven ;-)

Ответить
@markarca6360
@markarca6360 - 28.12.2022 01:18

One answer: LATENCY.

Ответить
@hotstovejer
@hotstovejer - 28.12.2022 02:26

One of the places I've worked at used global protect for VPN. When I would go to pull up Active Directory Users and Computers over the VPN, it would take 20 minutes. No, I'm not making it up. They transfer that data over SMB1. Painful AF. I ended up just writing some powershell to pull what I needed from AD.

Ответить
@oleksandrlytvyn532
@oleksandrlytvyn532 - 28.12.2022 02:27

Hello, which tool was used to add additional latency? Would be interested to see how it's done or know via which tool it was done

Ответить
@StarATL
@StarATL - 28.12.2022 02:31

Great explanation, but you left us wanting to know more…..like what we should be doing to address this. Is WebDAV or something else the way to go?

Ответить
@Sanosukejp
@Sanosukejp - 28.12.2022 02:57

Great video. Many ty

Ответить
@mabmachine
@mabmachine - 28.12.2022 03:41

Nice demo. Its physics, if you double the latency you essentially halve the realized bandwidth.

Ответить
@PatrykPabo
@PatrykPabo - 28.12.2022 04:00

what about NFS ?

Ответить
@bcredeur97
@bcredeur97 - 28.12.2022 04:43

What’s an alternative that is just as or almost as easy for your average joe to use to move his files around?

Ответить
@2008mjb
@2008mjb - 28.12.2022 04:46

Where was this when I was having to repeatedly explain this at work starting 3 years ago.

Ответить
@James_Knott
@James_Knott - 28.12.2022 05:16

IIRC, SMB was also noisy, at least on the local LAN. Several years ago, during the first time I worked at IBM, I was reading some internal documentation about adapting it to work over IP. It had a lot of issues that made it a generally bad protocol. Originally, it was strictly a local LAN protocol, before IP made routing possible.

Ответить
@biomerl
@biomerl - 28.12.2022 05:31

I hate to be that guy, but the title is a bit off-

Why are* smb file transfers slow over a vpn

I had to google it - is is for singular, are is for plural. "transfers" is plural so you are supposed to use "are" instead of "is"

Ответить
@LucidEnemy
@LucidEnemy - 28.12.2022 07:34

my biggest question here is what are good alternatives that the simple windows end user can use to use another protocol or solution, my clients typically end up with unraid+tailscale and mounted shares on the machines 98% of the time there local so latency is low however the 2% they use the SMB share over the VPN however where talking about 1-5mb word files so it doesnt matter as much as the backup that runs only during the day so as to have them local I would like to switch that to at night

Ответить
@buldozzer3456
@buldozzer3456 - 28.12.2022 09:45

I had SMB Multiplexing running over l2tp in a LAB. It scaled not that bad.

Ответить
@peterdee1900
@peterdee1900 - 28.12.2022 09:48

Great video!! I definitely had the same question.

Ответить
@databeestje
@databeestje - 28.12.2022 10:28

The other thing that people forget is that the upload speed of your own connection limits to how fast you can copy files to the main office . The default reaction to support is "But I have a 600mbit connection", yes, download to you, and a 60mbit upload that realistically limits it to 6MB/s.

It's a matter of perspective.

Ответить
@Daniel1987H
@Daniel1987H - 28.12.2022 14:26

Always wondered, why smb over OpenVPN sucks balls, but over wireguard it's basically fine.

Ответить
@aaronjden
@aaronjden - 28.12.2022 15:13

I had no idea. Thanks for the useful video!

Ответить
@sharedknowledge6640
@sharedknowledge6640 - 28.12.2022 15:59

Newer isn’t always better for SMB speed. A lot of the security “enhancements” actually hurt performance especially in versions from a year or two ago. Efforts have been made in the latest versions to improve the performance at least back to where it was. It would have been interesting to run the same test with NFS.

Ответить
@jfkastner
@jfkastner - 28.12.2022 21:36

Fragmentation and packet size issues are the main cause. MTU, payload size your VPN protocol, SMB blocksize, Window sizes/scaling etc all need to be "fine tuned" for your specific needs. Sadly though most SMB servers can not change those parameters "on the fly" based on destination, so you either have good VPN performance OR LAN performance (which most users/admins prefer) - but not both. FYI I had spent 5 days on an OpenVPN connection with Wireshark mostly and got about 75% of the WAN speed through the VPN with SMB. Your router and ISP do not care what traffic they carry!

Ответить
@tacioandrade
@tacioandrade - 29.12.2022 00:21

And what protocol do you recommend for this type of transfer? I'm asking this because I use sshfs, but I'm looking for more performant ways to solve the problem.

Ответить
@pnowikow
@pnowikow - 29.12.2022 00:46

That explains why

Ответить
@OzSigns
@OzSigns - 29.12.2022 02:50

Hi Tom, love your stuff. Would you have any detailed tutorial on how to access shares over the internet? I already have vpn , tunnel for services etc.

Ответить
@jas9450
@jas9450 - 29.12.2022 04:37

That thumbnail is hilarious 🤣

Ответить
@Saturn2888
@Saturn2888 - 29.12.2022 06:24

What should I use instead of SMB over VPN for Windows machines?

Ответить
@bwatk15
@bwatk15 - 29.12.2022 07:26

I think DFSR was designed with this in mine. It is the back end replication for Active Directory Domain Services SYSVOL. The problem is people misusing it for what it wasn't designed for (it is a lockless fileshare) . For example it can be set up for one way syncing Read-Write share to a Read share or two way which is where things go wrong when badly designed setups cause issues.

Ответить
@custard131
@custard131 - 29.12.2022 15:24

nice video but now you got me interested in seeing how other file sharing protocols perform in these conditions

Ответить
@udirt
@udirt - 29.12.2022 17:06

especially for OpenVPN there's some buffer parameters you really, really want test adjusting. send / receive buffers are disputed but worked very well where I tried them.
but - if the link speeds are just too low or for badly optimized applications, it's often better to give access to a terminal server where people then work.

Ответить
@FinderX
@FinderX - 29.12.2022 19:06

SMB is even worst in WIFI, only 2 mbps (megabit per sec) on 2GHZ, and a little faster on 5GHZ, but no much...

Ответить
@am3777
@am3777 - 29.12.2022 23:04

How were you able to add latency in your test?

Ответить
@f-s-r
@f-s-r - 30.12.2022 03:17

Very interesting.
What do you use to mount SMB file shares? I tried to do that some time ago, and the result was awful, like if the file transfer was never going to finish.
On the office i use rsync with the SSH-FTP protocol in windows with cygwin to update quite a lot of files over VPN. It seems to work very well.

Ответить
@dezejongeman
@dezejongeman - 30.12.2022 11:36

awsome had I known this earlier.
would NFS perform any better?

Ответить
@8xpdhpckkg
@8xpdhpckkg - 30.12.2022 16:05

Follow up Question then: do other protocols have similar penalties? What protocol would you recommend for large point-to-point file transfers over WAN?

Ответить
@Mitchell7790
@Mitchell7790 - 30.12.2022 17:57

Hi Tom, have you tested SMB over QUIC at all? This is what Microsoft introduced in Server 2022 for accessing SMB shares via services such Azure Files.

As far as I know there hasn’t been any other improvements in SMB over WAN other than this.

Ответить
@johnrambo6549
@johnrambo6549 - 30.12.2022 19:09

Can you do a video on how to prevent ARP poisoning on Pfsense

Ответить
@tundrastreaming
@tundrastreaming - 30.12.2022 19:58

Is there an alternative protocol for Windows to use? I know NFS exists for windows, but it doesn't have a UI and isn't really suited for normal people who don't want to mount via command line

Ответить
@icedutah
@icedutah - 27.02.2023 19:06

How did you add the latency to the connection?

Ответить
@jamesmyers777
@jamesmyers777 - 06.03.2023 10:42

Awesome video thanks

Ответить
@inadaizz
@inadaizz - 03.04.2023 20:30

Seriously thank you.

Ответить
@studiociodo
@studiociodo - 24.06.2023 21:07

The problem is clear, and the solution? Witch protocol YOU raccomand? WebDAV, FTP, NFS. Every of these protocol can easily implement in Windows. If security is demanded throw VPN how can you obtain usability on typical file server office situation?

Ответить
@someguy0523
@someguy0523 - 10.08.2023 02:23

Thanks, as a Windows guy tried getting around the SMB limitation by creating an iscsi lun over the vpn (gigabit internet on both ends). No problem creating the iscsi lun, but when transferring a file to the new lun I'm getting the same speed as smb. Topping out at 4MB/s, latency between sites is in the 16ms range. Thoughts?

Ответить
@brycez7352
@brycez7352 - 23.11.2023 07:48

Thank you so much for this video..

Ответить
@HisLoveArmy
@HisLoveArmy - 28.02.2024 03:09

So is there a protocol that works better than SMB but can also work on Windows?

Ответить
@mjj2u2
@mjj2u2 - 03.04.2024 23:13

Well Done!

Ответить