This project provides a minimal LD_PRELOAD-based shared object (nodelay.so)
that forces TCP sockets to disable Nagle’s algorithm (TCP_NODELAY), even if
the application doesn’t set it explicitly.
Make sure you have gcc installed, then run:
makeThis will produce nodelay.so.
Preload the shared object when running a TCP-based program:
LD_PRELOAD=./nodelay.so ./my_tcp_benchmarkThis forces all socket() and setsockopt() calls to set TCP_NODELAY on SOCK_STREAM sockets.
LD_PRELOAD=./nodelay.so curl http://localhost:8080make clean- Works only for TCP sockets (
SOCK_STREAM) - Has no effect on Unix domain sockets or UDP
- Designed for Linux
nodelay.c: Source code for the preload libraryMakefile: Build script
Apache-2.0