#define TCP_NODELAY 1 /* Turn off Nagle's algorithm. */
u8 nonagle : 4,/* Disable Nagle algorithm? */
ret = sock->ops->setsockopt(sock, SOL_TCP, TCP_NODELAY,
sock->ops->setsockopt(sock, SOL_TCP, TCP_NODELAY, (char __user
*)&val,
the above are just two of the examples of how to set TCP_NODELAY in the kernel.
http://www.linuxquestions.org/questions/other-*nix-55/how-do-i-disable-the-nagle-algorithm-in-enterprise-linux-3-kernel-ver-2-4-21-4-a-556170/
should be the correct way, except that the poster is attempting to do
it in a kernel that does not support it.
As documented in http://linux.die.net/man/7/tcp, the supported kernel
is 2.5.71 and onwards.
Okay ... so, the situation I have at hand is that there is this app I
cannot modify. I'd like to see its performance with nagle disabled. Is this
possible?
as u can see from the above two kernel implementation - each is
implementing the algorithm per-socket level, or connection-level, on
top of TCP, so, yes, u want to do that is possible. but u will need
to write a kernel module, that implement itself as a netfilter module,
specifically just for the port that your application is using, and
setup socket connection of TCP_NODELAY type. not sure if it will
work?
While at it, is there a way to see the socket options of the socket
descriptors in a running app?
Regards,
Yes, i think so, just sniff out the network packet, and identify the
correct bit as according to the header: include/linux/tcp.h:
<snip>
u16 advmss; /* Advertised MSS */
u8 frto_counter; /* Number of new acks after RTO */
u8 nonagle : 4,/* Disable Nagle algorithm? */
thin_lto : 1,/* Use linear timeouts for thin streams */
thin_dupack : 1,/* Fast retransmit on first dupack */
unused : 2;
<snip>
Kashyap
--
Regards,
Peter Teoh