Client Lag over VPN connection
Hello, our Shipworks DB server resides at our home office and I access it via VPN connection. My application opens but is constantly freezes for 10-30 seconds. It will unfreeze for 5-10 seconds then freezes up again. I am the only client this happens to. The other users do not have this issue. Originally I thought it was my connection speed but it is not. I recently changed to a 1gig fiber connection and my speed tests are both near 1gig up and down. I have uninstalled and reinstalled multiple times and also removed the local database that was on my PC. This has been an issue for 2 years now. What else can I do?
-
Long explanation of what is happening.
Bandwidth is not speed, it is capacity. Picture a highway. The number of lanes is bandwidth. Each car is one connection. The time to get from A to B is latency.
Bandwidth - What you pay for (1Gbps)
Latency - The cars only has one speed, so Latency is (mostly) determined by distance.
Connection - Determined by the software design (sending and receiving). For this discussion's sake, one per application.Your PC/Laptop is A.
Your Shipworks database is B.
To process shipments, you need to move some new stuff (your request) from A to B, and also bring back lots of old stuff (the results) from B to AWhen you are running Shipworks on the database server, The distance from A to B is small (inches), so the latency is small (0.07 ms = 70/1000ths of a second), and data is available very quickly.
When you are running Shipworks on different PC (A) than the server (B), you are crossing those inches, plus 100ish ft of wire, plus a lan switch. Your latency is now 0.2 ms (~3x slower). Less than 1/1000th of a second may not sound like much, but your application requests LOTS of records and the server can only return them 1500 bytes at a time. This means the the trip from B to A is made HUNDREDS of times for a typical request, and it takes 0.2 ms seconds for EVERY 1500 bytes. This is when you begin to feel a slight lag between you clicking and the screen changing. Still, on a LAN response is acceptably fast.
If the connection is in the same building, but over WIFI, the latency grows to 1-2 ms sec (14-28x slower). Here you really begin to feel the time between click and results. Big queries grow from seconds to minutes. I have one large report that takes 15 minutes over wifi.
If you relocate A to the coffee shop 25000ft (5 miles) away, latency jumps to 10ms (142x slower). Plus, your VPN can add another 5-10ms (280x slower)
If you relocate A severla hundred miles away, latency jumps to 20-40ms (285-571x slower). Plus another 5-10ms for VPN (714x slower). Now you're feeling exactly what you described, horrible performance. It's probably not locked up,just chewing through the request in minutes, possible tens of minutes per request.
Latency is governed by physics, and you cannot overcome latency any way except shrinking the distance.
Good so far? Ok, back to bandwidth.If you add 1000 more lanes (Gbps) as you have done, you can still only use one. The rest are free for your TV, kids phones, the other apps on your laptop, etc. Those lanes are why you can use shipworks and watch netflix at the same time.
You could speed data xfer up with more cars (connections) using more lanes (bandwidth). So... How do you do that? You can't. That is up to database
engineers, the language shipworks is written in, how the app engineers designed it, etc. It sounds easy to "add more cars", but all that data has to
be reassembled when it arrives (in random order), and that is complex.So I've told you why it won't work, what about how it can? Simple, use your VPN (secure) to connect to a remote session running on the database (or your office) PC. Teamviewer, gotoAssist, Microsoft RDP, VNC are all great options. All the heavy lifting happens locally, and you just get screenshots of the results.
Please sign in to leave a comment.
Comments
1 comment