Troubleshooting latency/packet loss
High latency (commonly called **ping**) and packet loss can make your applications feel slow or unstable. Latency is the time it takes for data to travel from your device to the server and back; packet loss occurs when some packets are dropped entirely during transmission. Both issues can cause rubber‑banding, timeouts and poor user experience.
**Diagnosing latency & packet loss**
- Use tools like `ping`, `traceroute` or the combined tool `mtr` to measure round‑trip time and see each hop along the path to your server. High latency or packet loss on the first hop indicates a local or ISP issue, while problems mid‑path or near the destination may be outside your control.
- Test from multiple networks (for example, your home connection vs a mobile data connection) to isolate whether the problem lies on your local network or somewhere else.
- Monitor your server’s CPU and memory usage. A busy server can introduce delays if it is overloaded.
- Check the network interface statistics on your server (`ifconfig` or `ip -s link`) to see if there are errors or dropped packets.
**Common causes of high latency**
- **Physical distance:** The farther your users are from the server, the longer packets take to travel. Choosing a server location close to your audience or using a content‑delivery network (CDN) reduces physical distance.
- **Network congestion:** Heavy web pages, large images and multiple third‑party scripts increase load times. Congested networks or busy routers and switches can add delay.
- **Transmission medium:** Wired Ethernet generally has lower latency and less interference than Wi‑Fi. Using a wired connection, upgrading to fibre or replacing old cables can help.
- **Hardware or software on the client side:** Latency can be caused by the client device running out of CPU/memory or by faulty cables, routers, switches or network interface cards. Ensure your local equipment is in good working order.
**Causes of packet loss**
- **Faulty hardware or cabling:** Damaged cables, failing switches or network interface cards can drop packets before they reach the destination.
- **Congested links:** When a network link is saturated, routers and switches may drop excess packets. This is common during peak usage hours.
- **Wireless interference:** Wi‑Fi networks are susceptible to interference from other devices and obstacles. Switching to a wired connection can reduce packet loss.
- **Misconfigured firewalls or security appliances:** Aggressive filtering rules, QoS policies or DDoS mitigation can inadvertently drop legitimate traffic.
- **Upstream provider issues:** Issues with your ISP or upstream carriers can cause packet loss outside your control. Performing tests from different networks helps identify such cases.
**Mitigation tips**
- Choose a server location close to your users to reduce latency and use a CDN to serve static content from edge locations.
- Optimise your website or application: compress images, enable HTTP/2, cache assets and minimise third‑party scripts to reduce page load times.
- Use wired connections wherever possible and upgrade networking hardware to handle the required throughput.
- Monitor your network and server health regularly, and address resource bottlenecks (CPU, RAM, disk I/O) that can contribute to latency.
- If tests indicate the problem lies outside your network, contact your ISP or IllusionCloud support with traceroute outputs and timestamps so they can investigate with upstream providers.
By diagnosing the root cause and following these mitigation steps, you can reduce latency, prevent packet loss and ensure a smooth experience for your users.