问题原文
原帖链接 · allo · CC BY-SA 3.0
I have a server with a Gigabit Uplink, and testing with iperf3 with 100 parallel connections i get at least 600 MBit/s, depending on the other server (i tried some public test servers).
But when i run iperf3 with one connection i get 10-15 MBit/s, with two 20-30 MBit/s and so on.
I do not have very complicated iptables rules and no other idea, why it is so slow. What can be the limiting factor for single tcp connections, that they are 10 times slower than the possible bandwidth?
已采纳解答
原帖链接 · allo · CC BY-SA 3.0
I finally found the cause of the problem.
I had some flask webapp, which uses redis to stream events to the user. When the user disconnected, the app kept the redis pubsub connection alive, without reading data anymore.
This leads to a long Send-Q/Recv-Q, which apparently cause the tcp stack to slow down and produce kernel warnings:
"TCP: out of memory -- consider tuning tcp_mem".
- Short term fix: Kill the processes with the long packet queues.
- Long term solution: Fixing the misbehaving programs.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
