Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High concurrency situation, returning packet loss, #104

Open
blade83lee opened this issue May 14, 2024 · 1 comment
Open

High concurrency situation, returning packet loss, #104

blade83lee opened this issue May 14, 2024 · 1 comment

Comments

@blade83lee
Copy link

High concurrency situation, returning packet loss,
2024/05/14 18:44:32 ping.go:201: D! no packets received, stats: &{{0 5 0 100 10.10.25.117 10.10.25.117 [] 0s 0s 0s 0s} 0}
but tcpdump has packet return
18:44:27.903699 IP 10.4.3.20 > 10.10.25.117: ICMP echo request, id 22102, seq 0, length 64
18:44:27.925773 IP 10.10.25.117> 10.4.3.20: ICMP echo reply, id 22102, seq 0, length 64
18:44:28.904025 IP 10.4.3.20 > 10.10.25.117: ICMP echo request, id 22102, seq 1, length 64
18:44:28.926564 IP 10.10.25.117 > 10.4.3.20: ICMP echo reply, id 22102, seq 1, length 64
18:44:29.903706 IP 10.4.3.20 > 10.10.25.117: ICMP echo request, id 22102, seq 2, length 64
18:44:29.928764 IP 10.10.25.117 > 10.4.3.20: ICMP echo reply, id 22102, seq 2, length 64
18:44:30.903703 IP 10.4.3.20 > 10.10.25.117: ICMP echo request, id 22102, seq 3, length 64
18:44:30.927299 IP 10.10.25.117 > 10.4.3.20: ICMP echo reply, id 22102, seq 3, length 64
18:44:31.903708 IP 10.4.3.20 > 10.10.25.117: ICMP echo request, id 22102, seq 4, length 64
18:44:31.926030 IP 10.10.25.117 > 10.4.3.20: ICMP echo reply, id 22102, seq 4, length 64

How to optimize

@ZhaoBaymax
Copy link

On the sending end: the CPU will allocate a socket connection for each ICMP. That is to say, even in the case of coroutines, it is necessary to wait for the CPU to switch contexts. The start time is calculated in user mode, and there is still some time before the packet is actually sent out. Similarly, on the receiving end, this situation also exists. You can check the scheduling time of the service CPU to confirm this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants