Re: TCP receive too many small packets

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"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) );



.



Relevant Pages

  • Re: Diagnose co-location networking problem
    ... it was from the client. ... Actually there's significant indication of lost packets and clues that ... 540 retransmit timeouts ... are you using any packetfiltering on the server? ...
    (freebsd-net)
  • Re: process stuck in nfsfsync state
    ... >> server is wedged, not the client. ... Comparing the client and server traces, it looks like fragments in the ... loss for individual packets adds up. ...
    (freebsd-stable)
  • Re: TDS vs. TCP
    ... I start capturing the network traffic between SQL ... Server and the client. ... I don't see any TDS packets but the communication between SQL ... stand-a-lone server and the client, ...
    (microsoft.public.sqlserver.clustering)
  • Re: DHCP
    ... DHCPINFORM is used only if the client has ... >>> I would run ethereal on the server and catch all the packets exchanged ... >>> between the client and server. ... > implies that the host has a "working" IP address. ...
    (comp.os.linux.networking)
  • Re: "Listen on" semantics
    ... the worst thing may well be a screwed-up clock (and ... of packets that were crafted on purpose by malicious minds. ... server then you have a bigger problem since ntpd is not designed to work ... What I want is not so much two copies of ntpd as a separation between client and server functionality. ...
    (comp.protocols.time.ntp)