whenever I write data to a tcp socket, it waits until its filled with enough data ex: 64k (max packet size) then it sends data to the wire. this misses the data at the right time for the other end.
when I set TCP_NODELAY, any data written to socket is sent to the wire immediately. this reduces the bandwidth as we have lots of small packets with ACKs.
can we set a rule for linux to flush out sockets conditionally? ex:
if time gap between last sent packet and current data is greater than 100ms send immediately no matter how much data lendth is
else if current data length is bigger than 50kb send immediately no matter how much time gap is
else do nothing, wait some milliseconds for next decision
I dont want to reduce tcp buffer size, want to modify how linux flushes data out.
can we do this just by playing with linux configuration files? or this must be implemented in each software written?
any direct answer, help, solution or link to an article, is appreciated