Intel® Moderncode for Parallel Architectures
Support for developing parallel programming applications on Intel® Architecture.

Latency From send() call around 20 microseconds?

bwy
Beginner
393 Views

Hi Everyone,

I'm sorry if this is the incorrect forum. My question is I have an application running on Linux that makes a call to send(), to of coarse send a packet over TCP/IP (Nagling is disabled and the payload is 4 bytes). The thing I can't get over is tcpdump and my own timing of the send() function return 20 microseconds.

I can't figure any reason why there would be 20 microseconds delay in any of the code run once send() is called. Is there any chance that the 20 microseconds is occuring somewhere in the hardware? I'm using a Pentium Dual Core around 2.0 GHz. My ethernet card is onboard. If I used a PCI card would it be faster?

Anyway, if the latency is in the hardware, could someone please help me understand why this is occuring?

Thanks!
Brandon

0 Kudos
1 Reply
Tom_Spyrou
Beginner
393 Views
If it were me I would write a loop of these and use oprofile to see what is happening.
It could be that the send() causes a context switch. Is your socket blocking or non-blocking?
0 Kudos
Reply