Client Lag over VPN connection


1 comment

  • Avatar

    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 A

    When 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.


    Comment actions Permalink

Please sign in to leave a comment.