diff --git a/content/how-to-lower-ping.md b/content/how-to-lower-ping.md index 67e6511..acc6ec8 100644 --- a/content/how-to-lower-ping.md +++ b/content/how-to-lower-ping.md @@ -6,10 +6,10 @@ date = 2024-11-06T08:08:27-08:00 # TL;DR -1. Have your player(s) with high latency visit [http://ping.gl.ply.gg](http://ping.gl.ply.gg) and see which datacenter they are getting routed to (`tunnel_name` shows datacenter). If the datacenter is far from you and the player, consider getting using a regional tunnel with {{< link "playit-premium" >}}. +1. Have your player(s) with high latency visit [http://ping.gl.ply.gg](http://ping.gl.ply.gg) and see which datacenter they are getting routed to (`tunnel_name` shows datacenter). If the datacenter is far from you and the player, consider using a regional tunnel with {{< link "playit-premium" >}}. 2. If you're hosting a server using WiFi, try moving to a wired connection. -3. Restart your router, sometimes the router gets into a funky state and [buffer bloat](https://www.waveform.com/tools/bufferbloat) becomes a big issue. -4. If your hosting Minecraft, try lowering `view-distance`. More details on {{< link "minecraft-timeout" >}}. +3. Restart your router, sometimes the router can get into a funky state and [buffer bloat](https://www.waveform.com/tools/bufferbloat) becomes a big issue. +4. If you are hosting Minecraft, try lowering `view-distance`. More details on {{< link "minecraft-timeout" >}}. # What is ping? @@ -20,7 +20,7 @@ and run: ping ping.ply.gg ``` -The ping command will send an ICMP packet (a ping message) to one of playit's global servers and that server will respond with a pong message. The ping comamnd will then tell you how long it took in milliseconds to receive the response. +The ping command will send an ICMP packet (a ping message) to one of playit's global servers and that server will respond with a pong message. The ping command will then tell you how long it took in milliseconds to receive the response. ![ping-response]({{< static "post-img/ping-command-response.png" >}}) ![ping]({{< static "post-img/ping.png" >}}) @@ -29,11 +29,11 @@ The ping command will send an ICMP packet (a ping message) to one of playit's gl While knowing your ping to one of playit's servers is helpful, it doesn't give you a clear picture of what the ping will be in game for your players. The truth is, the ping in game is much more complicated. The ping will likely be different for every player, may change over time, and may get worse if someone is running a microwave in your house. The best way to determine what your in game ping will be is to measure it. So setup a server, get some friends online, and start measuring. -But you want to lower ping / latency. Well you're in luck, there might be some things you can do. However first, I think it's important for you to know how playit.gg works and what variables you have to try and improve your ping. +But you want to lower ping / latency. Well, you're in luck as there may be some things you can do on your end to help. However first, I think it's important for you to know how playit.gg works and what variables you have to try and improve your ping. ## How traffic flows through playit -Playit has tunnel servers distributed across the world. When your server is made public with playit.gg, traffic flows through our tunnel servers. For the point of illustration, let's imagine your hosting a Minecraft server and one of your players is measuring ping to the server in game. This is how the traffic (and the ping test) flows through our network: +Playit has tunnel servers distributed across the world. When your server is made public with playit.gg, traffic flows through our tunnel servers. For the point of illustration, let's imagine that you are hosting a Minecraft server and one of your players is measuring ping to the server in game. This is how the traffic (and the ping test) flows through our network: ![playit-hops]({{< static "post-img/playit-hops.png" >}}) @@ -45,7 +45,7 @@ Playit has tunnel servers distributed across the world. When your server is made 4. **Hop 4**: The response is relayed to the player's (client's) computer. -The ping of your server in game can be approximated by calcuating +The ping of your server in game can be approximated by calculating ``` Latency(Hop 1) + Latency(Hop 2) + Latency(Hop 3) + Latency(Hop 4) @@ -55,11 +55,9 @@ Often the biggest thing you can do to adjust latency is to change where traffic ### Adjust traffic from the playit agent -On the playit webpage for your agent, you can see the ping from your playit agent to our tunnel servers. This value about `2 * Latency(Hop 3)`. So in my case `Latency(Hop 3) = 7ms`. If I were a connecting to my own server on playit.gg, `Latency(Hop 3) + Latency(Hop 4) = 14ms`. As a I said, sorta complicated. - ![agent-ping]({{< static "post-img/agent-latency.png" >}}) -You can change which datacenter you're getting routed to. Do note, this does not currently work for our Minecraft Plugin and old versions of the playit program. Changing this value will directly influence `Latency(Hop 3) + Latency(Hop 4)` in your players overall ping. In general, for the best performance you want the reported ping for your playit agent to be as low as possible. +You can change which datacenter you're getting routed to. Do note, that this does not currently work for our Minecraft Plugin and old versions of the playit program. Changing this value will directly influence `Latency(Hop 3) + Latency(Hop 4)` in your player's overall ping. In general, for the best performance you want the reported ping for your playit agent to be as low as possible. You can also try disabling IPv6, which sadly on some networks improves latency and reliability. @@ -67,7 +65,7 @@ You can also try disabling IPv6, which sadly on some networks improves latency a ### Adjust where client traffic goes -This requires playit premium. With playit premium you can create regional tunnels. A regional tunnel will ensure the client connecting your tunnel will get routed to a datacenter in the tunnel's region. Each player can approximate `Latency(Hop 1)` by finding their ping to the tunnel's region and dividing the value by 2, `Latency(Hop 1) = $(ping ping..ply.gg) * 0.5`. If you're hosing the server and also connecting, `Latency(Hop 1) + Latency(Hop 2) = $(ping ping..ply.gg)`. +This requires playit premium. With playit premium, you can create regional tunnels. A regional tunnel will ensure that the clients connecting to your tunnel will get routed to a datacenter in the tunnel's region. Each player can approximate `Latency(Hop 1)` by finding their ping to the tunnel's region and dividing the value by 2, `Latency(Hop 1) = $(ping ping..ply.gg) * 0.5`. If you're hosting the server and also connecting, `Latency(Hop 1) + Latency(Hop 2) = $(ping ping..ply.gg)`. **Ping commands to playit regions** @@ -82,7 +80,7 @@ ping ping.as.ply.gg # Asia Tunnel # Other reasons for High Ping -A lot of in game latency / ping will simply be due to needing to send data long distances and in the case we're limited by the speed of light through glass. However, there are other factors which can affect ping quite a bit. +A lot of in game latency / ping will simply be due to needing to send data long distances and in this case, we're limited by the speed of light through glass. However, there are other factors which can affect ping quite a bit. ## Network Bandwidth @@ -94,7 +92,7 @@ When you're sending data to players you need to wait for that data to be sent be ![agent-ping]({{< static "post-img/bandwidth.png" >}}) -Like everything, this is complicated. Some game servers will be greedy and brust sending data to a new player which can take away available bandwidth for other players. +Like everything, this is complicated. Some game servers will be greedy and burst sending data to a new player which can take away available bandwidth for other players. **Some examples with Minecraft Java** @@ -110,33 +108,31 @@ With a Vanilla Minecraft Java server here's how much data is sent to a connectin * view-distance: **10** => ~1900ms * view-distance: **32** => ~2600ms -> Most home internet routers have some form of Quaility of Service (QoS) prioritization applied to the upload bandwidth to lower how much one greedy -> connection can block others. Your router being smart* does help lower the affect but not elimiate it. It's also possible your router is doing a bad +> Most home internet routers have some form of Quality of Service (QoS) prioritization applied to the upload bandwidth to lower how much one greedy +> connection can block others. Your router being smart does help lower the impact but does not always eliminate it. It is also possible that your router is doing a bad > job and might need a restart. See our section on [Buffer Bloat](#buffer-bloat) for more details. > -> Through testing we've found the official Vanilla Minecraft Java server is greedy with bandwidth. It will brust data to new clients. PaperMC which we've -> also tested does a much better job smoothing out the traffic which can help lower this affect too. +> Through testing we've found the official Vanilla Minecraft Java server is greedy with bandwidth. It will burst data to new clients. We have also tested the PaperMC server software, and have found that it does a much better job smoothing out the traffic which can help lower this effect too. ### How to improve? -1. Where possible, update your server settings to lower how much data you're sending. In minecraft this can be done with `view-distance` in `server.properties`. -2. Lower internet usage from other devices on your Network. -3. Restart your router, it might be doing QoS poorly and need a reset. -4. Get a faster internet connection from your ISP, you need more Upload Bandwidth. Easier said than done for many. +1. Where possible, update your server settings to lower how much data you're sending. In Minecraft this can be done with `view-distance` in `server.properties`. +2. Lower internet usage from other devices on your network. +3. Restart your router, it might be doing QoS poorly and needs a reset. +4. Get a faster internet connection from your ISP, you need more upload bandwidth. Easier said than done for many. ## Buffer Bloat Lifted from [https://www.waveform.com/tools/bufferbloat](https://www.waveform.com/tools/bufferbloat) (great resource) > Bufferbloat is a software issue with networking equipment that causes spikes in your Internet connection’s latency when a device on the network uploads or downloads files. -Often the router or modem form your ISP is a low end device that lots of issues. Over time the software can get into a funky state and the device can perform quite poorly. These performance issues often show -up when the device is under load (lots of traffic moving through it). +Often the router or modem from your ISP is a low-end device that can sometimes have several issues. Over time the software can get into a funky state and the device can perform quite poorly. These performance issues will often occur when the device is under load (lots of traffic moving through it). -Give your router a test: [buffer bloat test](https://www.waveform.com/tools/bufferbloat). Sometimes a simple restart of the router is enough to get it working better. Helping users on the Discord I've been surpised by how much a simple restart of the router has improved their ping in game. +Give your router a test: [buffer bloat test](https://www.waveform.com/tools/bufferbloat). Sometimes a simple restart of the router is enough to get it working better. When helping users on the Discord, I have been surprised by how much a simple restart of the router has improved their ping in game. ## Use a wired connection -If you can, use a wired connection for computer running playit and hosting your game server. WiFi constantly drops packets. WiFi works by trying to send packets at random times on a shared frequency. If two devices happen to send a message at the same time, both will wait a random amount of time and then retry. While they're waiting, no data is being sent from your game server. When running a game server you are constantly sending data, so anytime another device decides to use the internet (including devices from your neighbors or a random microwave turning on) the data will be dropped and your server's upload will pause. These conflicts can cascade causing their to be more and more data your server needs to send making the problem exponentially worse. It's possible for this alone **to add MULTIPLE SECONDS to your in game ping!** +If you can, use a wired connection for the computer running playit and hosting your game server. WiFi constantly drops packets. WiFi works by trying to send packets at random times on a shared frequency. If two devices happen to send a message at the same time, both will wait a random amount of time and then retry. While they're waiting, no data is being sent from your game server. When running a game server you are constantly sending data, so anytime another device decides to use the internet (including devices from your neighbors or a random microwave turning on) the data will be dropped and your server's upload will pause. These conflicts can cascade causing their to be more and more data your server needs to send making the problem exponentially worse. It's possible for this alone **to add MULTIPLE SECONDS to your in-game ping!** -The story is different with WiFi 6 if both your router and device support it, but that sill has issues. If you can, using a wired Ethernet connection is your best option. +The story is different with WiFi 6 if both your router and device support it, but that still has issues. If you can, using a wired Ethernet connection is your best option.