Change kernel to always be in tcp quick ack mode
Hi, my Java program is running into some occasional-yet-significant delay when writing to a TCP socket. The problem seems to be that my side is delaying packets because it's waiting for the other side to send more data so that my side can piggy-back its data on the next ack to the other side.
It looks like I can fix this by calling tcp_enter_quickack_mode (found here: http://lxr.linux.no/linux+v2.6.27.7/...p_input.c#L178 ). However, i) I can't call this from Java, and ii) even if I use C/C++, I have to call it before every send because the kernel turns it back off after every send - it looks like the pingpong flag is the relevant one? Has anyone ever modified the kernel so that this setting is always off? I'm no expert, so I'm a little wary of making changes without a voice of experience. Thanks |
Quote:
|
Well, unfortunately, I have no choice but to muck with it...I only have a TCP API to work with in this case, and latency minimization is critical.
I made the change I discussed, but it didn't fix my problem. That change only made me send my acks faster. I think the problem has to do instead with the congestion window. Is there a list somewhere of all the reasons a congestion window shrinks? (I have slow start disabled.) |
Hmm, looks like I can just set the minimum congestion window (min_cwnd) to something large enough to handle all of my data.
Sound right? |
you probably need to set socket option TCP_NODELAY on the sender side, what's most likely happening is the tcp packets aren't being sent until you've filled the buffer as opposed to immediately when you write a block of data. I think you can also set this with the tcp_low_latency in /proc but that would be system wide instead of just for one connection.
|
All times are GMT -5. The time now is 06:51 PM. |