In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "how high is the network delay in the docker container relative to the host". The explanation in this article is simple, clear and easy to learn and understand. Please follow the editor's train of thought to study and learn "how high the network delay in the docker container is relative to the host".
Verify environment preparation
This verification tool I used Netperf,Netperf is a network performance measurement tool, you can test based on TCP or UDP throughput, response rate. Netperf includes Clien and Server. The Server side is mainly used to realize the monitoring work, and the client side carries on the test. According to the traffic transmission mode, it can be divided into the following three types:
The maximum throughput in one direction transmits a large amount of data.
Both parties transfer data to each other, and for tcp, it is a single connection.
For tcp, each connection transmits data interactively.
Environmental information
There are two machines in total, one machine starts the NetPerf server; the other machine runs the Netperf client in the container and on the host.
NetPerf server
1. Download wget http://repo.iotti.biz/CentOS/7/x86_64/netperf-2.7.0-1.el7.lux.x86_64.rpm
two。 Install rpm-ivh netperf-2.7.0-1.el7.lux.x86_64.rpm
3. Start netserver
NetPerf client host authentication
First, install Netperf directly on the host, and then test the network performance, as shown below:
TCP_RR is specifically used in netperf to test network latency, with a default of 10 seconds at a time. After running, we also need to calculate the average number of TCP request/response per second. The higher the number of times, the smaller the latency. As shown above, a total of three rounds of tests were carried out, and the results were 20146, 20248 and 20221 respectively, with an average of 20221 arcs.
Verification in container
On the same client machine, start the docker service and install Netperf to verify it. The command [root@test ~] # docker run-d-name test-v / home/net/:/home/net/ docker.harbor.com/centos:7.8 sleep 36000 is shown below.
Here, I am equivalent to mounting Netperf inside the container, and then execute: docker exec-it test bash to install Netperf inside the container.
It also runs three rounds, and the results are 19546, 19541 and 19259 respectively, with an average of 19448 Universe s.
According to the data, the container is 773 times less than the host. 773max 20221 = 4%, that is, the network processing speed in the container decreased by 4%. Later, some paper were found on the Internet, and some people concluded that it was about 10%.
The container shares the host network operation.
[root@test] # docker run-d-name test-- network host-v / home/net/:/home/net/ docker.harbor.com/centos:7.8 sleep 36000
It can be found that when using the shared host network mode, the network delay is basically no different from that of the host.
Cause analysis
The reason for the network delay is not difficult to imagine, because each network data transmission has to go through the veth interface, and then sent out. This virtual network device has no hard interrupt, only soft interrupt processing, and the other logic is basically similar to the network card sending data, although the sending speed is very fast. But even so, it brings some network overhead, which causes network delay.
Thank you for your reading. the above is the content of "how high is the network latency in the docker container relative to the host". After the study of this article, I believe you have a deeper understanding of how high the network latency in the docker container is relative to the host, and the specific usage needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 209
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.