Pipelining and Output Buffering
Pipelining allows multiple outstanding requests, reducing round trips
Responses are still serialized - difference is timing
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 TCP_NODELAY socket option)