Re: TCP receive too many small packets
- From: "jerryk" <nospam@xxxxxxxxxx>
- Date: Thu, 20 Sep 2007 16:53:33 -0500
"Chris Becke" <chris.becke@xxxxxxxxx> wrote in message
news:%23u5wB11%23HHA.1900@xxxxxxxxxxxxxxxxxxxxxxx
"Tzicu" <adrian.rapiteanu@xxxxxxxxx> wrote in message
news:1190215505.723073.150080@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
I have a client / server application that communicates with each other
thru a socket connection.
The server application sends a lot, like 100,000 messages per second,
of small messages (60 bytes).
The client application that what it does is only to receive those
messages experience an increase in CPU usage in time.
Is something wrong with sending small TCP packets?
Im not sure I understand this question. Unless you ahve explicitly turned
it off, TCP will NOT send 100,000 60 byte packets per second. TCP sockets
are normally configured to wait ~200ms OR for a complete MTU (whichever
comes first) before sending a packet.
Disable the Nagle algorythm:
// Disable the Nagle Algorythm
char on;
on = 1;
setsockopt( socket, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on) );
.
- Follow-Ups:
- Re: TCP receive too many small packets
- From: Alexander Nickolov
- Re: TCP receive too many small packets
- References:
- TCP receive too many small packets
- From: Tzicu
- Re: TCP receive too many small packets
- From: Chris Becke
- TCP receive too many small packets
- Prev by Date: Re: TCP receive too many small packets
- Next by Date: Multiple IO on same socket (IOCP)
- Previous by thread: Re: TCP receive too many small packets
- Next by thread: Re: TCP receive too many small packets
- Index(es):
Relevant Pages
|