客户端将延迟的FIN ACK(〜500ms)发送到服务器 [英] Client sends delayed FIN ACK (~500ms) to server
问题描述
我有一个node.js客户端(10.177.62.7),它从服务器(10.177.0.1)的http rest服务请求一些数据.客户端只是使用node.js http.request()方法(agent = false).客户端位于Ubuntu 11.10机器上.
I have a node.js client (10.177.62.7) requesting some data from http rest service from server (10.177.0.1). Client is simply using node.js http.request() method (agent=false). Client is on Ubuntu 11.10 box.
为什么客户端在475毫秒后发送FIN ACK?为什么这么慢?他应该立即发送FIN ACK.我有很多这样的情况.大约有1%的总流量是通过延迟FIN ACK请求的.
Why client sends FIN ACK after 475ms? Why so slow? He should send FIN ACK immediately. I have many situations like this. About 1% of whole traffic is request with delayed FIN ACK.
客户端上的CPU闲置率约为99%,因此什么也不会耗尽CPU.
Cpu idle on the client is about 99%, so nothing is draining CPU.
如何调试呢?会是什么呢? 我需要调整任何sysctl选项吗?
How to debug this? What could it be? Is there any sysctl option I need to tune?
在屏幕快照的第二列上是数据包之间经过的时间.
On screenshot 2nd column is the elapsed time between packets.
推荐答案
此行为是 RFC1122 TCP堆栈.
通常,您应该将TCP_QUICKACK
选项添加到 Linux TCP套接字到禁用延迟的ACK ,但我认为使用JavaScript Node.js API并不明显(我只看到了socket.setNoDelay
(用于TCP_NODELAY
选项).
Normally you should add the TCP_QUICKACK
option to your Linux TCP socket to disable delayed ACK but I think it is not obvious with JavaScript Node.js API (I only saw socket.setNoDelay
for TCP_NODELAY
option).
因此您想在TCP堆栈上应用系统范围内的更改的想法似乎不错,但我找不到与该套接字选项行为匹配的sysctl
.这是另一个包含说明的完整列表.
So your idea to apply a system-wide change on TCP stack seems good but I found no sysctl
matching this socket option behaviour. Here is another full list with explanation.
这篇关于客户端将延迟的FIN ACK(〜500ms)发送到服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!