1

I am using blocking BOOST ASIO socket on Linux platform. In some read() operations, I see a massive latency of 500+ ms. (Mostly the latency is good but one off such huge latency is unacceptable)

I have already disabled Nagle's algorithm using the option

_socket->set_option( tcp::no_delay( true) );

I tried to search on the internet, and it seems that there are other things like Delayed Ack and PUSH flag which can ensure this latency goes away.

I am using Linux, PUSH flag setting is probably not available in Linux. Not sure of the setting for Delayed Ack on BOOST. (Should I use native socket descriptor extracted from boost socket?)

Closing this question, the delay was from the receiver side. The underlying protocol implemented between client and server is such that receiver does not give a flag to the sender for sending more packets. Nothing in there at TCP level. Application level implementation is bad.

Groovy
  • 516
  • 5
  • 16
  • 3
    The real question is what are you connecting to with this socket? It's quite possible that the hang-up is on the other end of the connection, not yours. – Richard J. Ross III Mar 15 '13 at 13:57
  • 2
    And how did you measure this latency? Where is it coming from? –  Mar 15 '13 at 14:01
  • 1
    And have you disabled the Nagle's algorithm on the _sending_ side? It will have no effect on the receiving side. Did you make sure the sending side did actually send the data? – Jan Hudec Mar 15 '13 at 14:49
  • 1
    Try enabling TCP_QUICKACK, as described in the answer here: http://stackoverflow.com/questions/1615447/disable-tcp-delayed-acks – Lazylabs Mar 15 '13 at 18:15
  • @RichardJ.RossIII I agree with you but I wish I could prove that. – Groovy Mar 17 '13 at 14:14

1 Answers1

0

The delay was from the receiver side. The underlying protocol implemented between client and server is such that receiver does not give a flag to the sender for sending more packets. Nothing in there at TCP level. Application level implementation is bad. Closing this question.

Groovy
  • 516
  • 5
  • 16