Oliver Schonrock: > However... > When sending it from a machine which has Sendmail installed and I use > the sendmail "client" binary which comes with that the delay is 10x > greater ~0.1s.
This means that some client implementation does small writes back-to-back, and therefore the client suffers from Nagle delays. > I also get the larger delay when sending using a userland php library > (my actually use case). > > When using my php library I was able to isolate the delay to the > END_OF_DATA command ie > > <CR><LF>.<CR>LF> The client implementation does small writes back-to-back, i.e. it sends the last portion of the message in one write operation and then it sends <CR><LF>.<CR>LF> in another write operation. This means that the client implementation does small writes back-to-back, and therefore the client suffers from Nagle delays. The fix is for the client to append <CR><LF>.<CR>LF> to the message content before writing it to the network. The workaround is for the client to turn off Nagle delays. Wietse