Pipelining and Output Buffering (Cont.)
Buffering packs TCPs segments better
Reduces number of packets (and server context switches) required for same "work"
Saves packets, CPU time, and ultimately elapsed time
When to Flush?
If the data in the output buffer exceeds 1K
If the data is buffered longer than N ms
If the application explicitly requests it
Experimenting with Nagle's algorithm
Turned on/off in both client and server
No differences seen in initial tests, but later tests showed its effect.
Recommend disabling Nagle (set the TCP_NODELAY socket option)