Network latency is the time it takes for data packets to be transmitted from the sender to the receiver. Find out everything you need to know about it, including the factors that increase latency and solutions to reduce it.
Latency is a measure of delay. In the area of networks, it defines the time it takes for data to reach its destination. As a rule, it is measured in terms of the time it takes for a data packet to be transmitted to the recipient and returned to the sender. The time required to make this round trip is the latency time. Ideally, it must therefore be as close to 0 as possible. The higher it is, the more it affects the performance of the network.
What causes latency?
Several factors can increase latency. To begin with, propagation is the time it takes for a packet to travel from one point to another at the speed of light. However, a delay is added according to the “medium” used to transfer the data fiber optics, wireless connection…
Besides.., the size of the packet must also be taken into account. A larger package takes longer to reach its destination and return. Using a router, or any other network gateway, adds a delay because it takes time to examine or even modify the packet header.
In addition, at each end of the network, the packet may be stored or accessed on hard disks or other data storage media of intermediate devices such as switches and bridges, causing further delay. All these different factors can increase latency.
How to reduce latency?
To reduce the latency time, it is necessary to bring in hardware, software and even mechanical optimizations and improvements. Within a computer, it is possible to remove or reduce latency by using a variety of techniques.
The prefetching consists in anticipating the needs related to data entry requests. Multithreading is the use of parallelism on multiple execution threads. It is also possible to uninstall unnecessary programs, optimize the network configuration and improve the hardware.
In the case of a website, there are also several ways to reduce latency. The use of HTTP/2 reduces server latency minimizing the number of round trips required between the sender and receiver through parallel transfers. This will allow web resources to load faster, improving page loading time.
Another trick is to reduce the number of external HTTP requestsThese external requests can strongly increase the latency of a website depending on the speed and quality of the third party server.
It is also possible to use a CDN (Content Delivery Network) to bring resources closer to the user. In this way, the user’s requests have to travel a shorter distance. The same is true, Browser Caching. allows you to cache some of the website resources locally to reduce the number of requests sent back to the server.