3

I could not find anything on the net to disable Nagle's Algorithm from the command line in Linux. Solaris does have a mechanism to enable/disable it from the command line.

Please let me know if there is any way of doing it on Linux.

sth
  • 222,467
  • 53
  • 283
  • 367
PhiberOptixz
  • 512
  • 6
  • 13
  • Have a look at the answer on the closed question http://stackoverflow.com/questions/17842406/how-would-one-disable-nagles-algorithm-in-linux. – Don Branson Aug 19 '15 at 13:30

4 Answers4

2

It's done per socket, not from the command line, using setsockopt() to set the TCP_NODELAY flag. I am aware of no method for doing this globally, though it wouldn't surprise me if there was a file under /proc/sys/net to do this...

Andy Ross
  • 11,699
  • 1
  • 34
  • 31
0

For redhat Linux, you can look at /proc/sys/net/ipv4/tcp_delack_min option. For other distributions, you may need to recompile kernel.

Hardy Feng
  • 459
  • 4
  • 13
0

You can also set the environment variable SETTCPNODELAY to any value to disable Nagle's algorithm.

Toddinpal
  • 345
  • 1
  • 7
0

Or set ACK timeout lower and stop TCP_RTS. The timeout is 2ms. It's the ping time to the next rj45 interface or next machine. Do not set the timeout too low, as you may get packet loss ;-). TCP.fin has a higher timeout.

echo 0.2 > /proc/sys/net/ipv4/tcp_ack_timeout
echo 0.2 > /proc/sys/net/ipv4/tcp_syn_timeout
echo 0.2 > /proc/sys/net/ipv4/tcp_synack_timeout
echo 0 > /proc/sys/net/ipv4/tcp_rst_timeout
echo 0.2.5 > /proc/sys/net/ipv4/tcp_fin_timeout
echo 0.2 > /proc/sys/net/ipv4/tcp_urg_timeout
echo 0.2 > /proc/sys/net/ipv4/tcp_psh_timeout
echo 10000 > /proc/sys/net/ipv4/tcp_syn_retries
echo 10000 > /proc/sys/net/ipv4/tcp_synack_retries
echo 0 > /proc/sys/net/ipv4/tcp_rst_retries
echo 10000 > /proc/sys/net/ipv4/tcp_psh_retries
echo 10000 > /proc/sys/net/ipv4/tcp_urg_retries
echo 10000 > /proc/sys/net/ipv4/tcp_ack_retries
echo 10000 > /proc/sys/net/ipv4/tcp_fin_retries
echo 0 > /proc/sys/net/ipv4/tcp_timestamps

And maybe:

echo 1 > /proc/sys/net/ipv4/tcp_dsack