samwise
samwise

Reputation: 357

High latency for linux network app

I am playing around with linux network programming and I wrote a little client server app which bounces a small message between a client and a server process and measures the round trip time. Consistently I see around 80ms for localhost round trip (this is after connection setup). This seems extraordinarily high. The same machine running the same code will clock substantially below 1ms on Vista.

Any ideas on where this difference could come from? The code is pretty straightforward, accept on one end, connect on the other and then just send/receive through the peer socket.

I am just begining on Linux, apologies if this is a silly question.

Upvotes: 2

Views: 1314

Answers (1)

cmeerw
cmeerw

Reputation: 7356

If you are using TCP sockets, then you might want to disable the Nagle algorithm (by setting the TCP_NODELAY socket option).

Upvotes: 6

Related Questions