Disabling the Nagle Algorithm is a good idea
The Nagle algorithm attempts to try and optimize the size of the packets being sent out.
Vismay explains the analogy that it’s like rather than sending two letters with an envelope, address and stamp, the Nagle algorithm takes the content of two letters and delivers them as one letter.
But as I point out this feels like a problem better solved by the application writer rather than the programmer who implements the network stack. So it’s better to turn it off and let the application code optimize how it writes to sockets.