There are many ways to measure the performance of a server or data center, one of which is to measure its latency. Server latency should be kept low to improve performance. So what does latency have to do with server monitoring? Read more about server latency, the causes of latency, and how to manage it below.
What is Latency?
Latency describes the delay in communication over a network between a server and a user. Latency is the time (measured in milliseconds) it takes for data to travel from source to destination.
So what is considered good latency? Latency of less than 100-150 ms is considered acceptable. But for optimal performance, latency should be in the range of 30-40 ms. Latency is considered good if it is close to 0.
Here are the measures of latency levels and their impact on user experience:
Latency Measures | User Experience |
<30 ms | Little to no impact, aka smooth sailing |
30-60 ms | Server is running well |
60-100 ms | Acceptable, but users may feel a slight impact, e.g. opening the web is a little slower, downloads take longer, etc. |
100-150 ms | Users feel what is called “slow internet” |
>150 ms | Internet still works, but starts to become annoying in most modern applications |
Common Causes of Latency
There are at least 4 factors that affect latency: distance, data size, software, and hardware used. The following is a further explanation of what causes high latency on servers and networks:
1. DNS Errors
When a Domain Name System (DNS) or web server experiences interference, it can make accessing data on the server more difficult, thus causing high latency. One example of a web server outage is the appearance of the code “error 500.”
2. Network Problems
The occurrence of network problems that transmit data from the server to the end user can also be the cause of high latency on the server. Certain network devices, such as switches or routers, can suddenly cause latency to increase if the CPU is overloaded or runs out of memory, making data transfer less than optimal.
3. There is a Problem with the Transmission Media
The purpose of the transmission media is to connect the sender and receiver so that they can exchange data by converting the data into manipulated code. If the transmission media is not compatible with the hardware or software being used, it can cause increased latency.
4. Too Many Routers
Routers function as connectors or connectors. But if there are too many routers then it can cause the network to slow down leading to high latency. This mainly happens when data moves from one router to another.
5. Extreme Weather
When network users and servers send data on a sunny day, the process will generally go smoothly. But in bad weather such as heavy rain and storms, network signals usually slow down and result in high latency. This happens because the network collides, the signal is not strong enough to transfer data, thus causing high latency.
6. User Device Problems
In addition to network or server performance, increased latency can also be caused by user devices. This may be due to memory or RAM limitations, as well as high CPU usage on the device.
How to Manage Latency to Keep It Low
Latency management is necessary for better network performance and minimizing the occurrence of “slow internet” which is very annoying for customers. There are several ways to manage latency to keep it low, including:
1. Use a CDN
CDN is a Content Delivery Network, which is able to reduce network latency by shortening the distance between the user and the origin server, using closer Points of Presence (PoPs). The distance from the server to the user is often a problem of high latency. CDN solves the distance problem and brings the server closer to the user.
2. Browser Caching
Caching is an effective technique to reduce latency and improve website performance. Thanks to caching, data is temporarily stored on the PoP server, bringing all packets closer and faster to the end user.
3. Eliminate Render-Blocking Resources
Resources that block rendering are pieces of code (usually CSS and JavaScript) that prevent web pages from loading quickly, thus creating longer latency. However, some pieces of code are not always necessary for the immediate user experience. That’s why it’s important to prioritize which content the browser should process with high priority.
To eliminate render-blocking resources and avoid overly busy browsers that cause high latency, do the following:
- Remove CSS that is no longer used
- Minimize CSS and JavaScript
- Delay JavaScript using the async and defer attributes.
4. Reduce TTFB
TTFB is Time to First Byte, which is the total time it takes for the server to send the first data after the user requests it. TTFB measures how long it takes for the server to respond. A slow server response time affects website responsiveness and speed, resulting in increased latency.
To reduce TTFB, choose powerful hosting, so it can handle high traffic loads, servers with sufficient memory, caching, and maintain optimized databases. A CDN can also help ensure high uptime and fast server response, no matter where the user is in the world. What is a good TTFB score to reduce the risk of high latency? It is recommended that TTFB be below 200 ms for server response time.
5. Optimize Images and Use Lazy Loading
Another way to reduce latency is by serving optimized images on the company website and using lazy-loading scripts. Optimized images mean presenting them in the smallest possible file size without compromising their quality. To ensure optimized images on the web, you can use the methods below:
- Convert images to WebP or AVIF format instead of JPEG
- Resize and compress images efficiently
- Adapt to mobile devices.
6. Use Reliable Monitoring Tools
Currently, there are network and server monitoring tools available in the form of reliable software to always check the condition of servers and networks. This tool will monitor continuously so that it can easily find out if there are signs that can slow down the work of servers and networks.
By finding these signs, the network management team can decide to solve the problem as quickly as possible so that latency does not get so severe that it disturbs customers. To keep server latency low, use reliable network and server monitoring tools, such as Netmonk from Telkom Indonesia. With its product, Netmonk Prime, the monitoring is very thorough and able to provide accurate reports and analysis. Just check the complete info on the Netmonk website!