2001-12-17 21:03:44

by Ahmed, Zameer

[permalink] [raw]
Subject: Turning off nagle algorithm in 2.2.x and 2.4.x kernels?

Hi,
Is there a way to turn off nagle compression in the kernel for 2.2.x
and 2.4.x kernels? For the same custom app used under Solaris and Linux.
Turning off nagle algorithm boosted perf on Solaris, I tried commenting out

#bool 'IP: Disable NAGLE algorithm (normally enabled)' CONFIG_TCP_NAGLE_OF

from the net/ipv4/Config.in 2.2.19 kernel and still the degradation in
network performance for packts in midsize persists
I tried the 2.4.16 kernel. This gave me very slight improvement, but not
quite what is expected.

TIA
Zameer A.


2001-12-17 22:13:06

by Russell King

[permalink] [raw]
Subject: Re: Turning off nagle algorithm in 2.2.x and 2.4.x kernels?

On Mon, Dec 17, 2001 at 04:03:15PM -0500, Ahmed, Zameer wrote:
> Hi,
> Is there a way to turn off nagle compression in the kernel for 2.2.x
> and 2.4.x kernels? For the same custom app used under Solaris and Linux.
> Turning off nagle algorithm boosted perf on Solaris, I tried commenting out
>
> #bool 'IP: Disable NAGLE algorithm (normally enabled)' CONFIG_TCP_NAGLE_OF
>
> from the net/ipv4/Config.in 2.2.19 kernel and still the degradation in
> network performance for packts in midsize persists
> I tried the 2.4.16 kernel. This gave me very slight improvement, but not
> quite what is expected.

Erm, commenting out a configure option to turn something off doesn't turn
that item off. It just leaves you without the question (and the feature
remains on).

You want to say 'y' to this option to disable nagle.

--
Russell King ([email protected]) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html

2001-12-18 04:29:22

by Andi Kleen

[permalink] [raw]
Subject: Re: Turning off nagle algorithm in 2.2.x and 2.4.x kernels?

[email protected] ("Ahmed, Zameer") writes:

> Hi,
> Is there a way to turn off nagle compression in the kernel for 2.2.x
> and 2.4.x kernels? For the same custom app used under Solaris and Linux.
> Turning off nagle algorithm boosted perf on Solaris, I tried commenting out
>
> #bool 'IP: Disable NAGLE algorithm (normally enabled)' CONFIG_TCP_NAGLE_OF
>
> from the net/ipv4/Config.in 2.2.19 kernel and still the degradation in
> network performance for packts in midsize persists
> I tried the 2.4.16 kernel. This gave me very slight improvement, but not
> quite what is expected.

Read the tcp(7) manpage. Enabling the TCP_NODELAY socket option disables
nagle per socket. The Config option is a noop and hasn't done anything for
a long time.

-Andi

2001-12-18 09:45:20

by Peter Wächtler

[permalink] [raw]
Subject: Re: Turning off nagle algorithm in 2.2.x and 2.4.x kernels?

"Ahmed, Zameer" schrieb:
>
> Hi,
> Is there a way to turn off nagle compression in the kernel for 2.2.x
> and 2.4.x kernels? For the same custom app used under Solaris and Linux.
> Turning off nagle algorithm boosted perf on Solaris, I tried commenting out
>
> #bool 'IP: Disable NAGLE algorithm (normally enabled)' CONFIG_TCP_NAGLE_OF
>
> from the net/ipv4/Config.in 2.2.19 kernel and still the degradation in
> network performance for packts in midsize persists
> I tried the 2.4.16 kernel. This gave me very slight improvement, but not
> quite what is expected.
>

there is a setsockopt() - apply it to the fd returned from accept()

man 7 tcp

SOCKET OPTIONS
To set or get a TCP socket option, call getsockopt(2) to
read or setsockopt(2) to write the option with the socket
family argument set to SOL_TCP. In addition, most SOL_IP
socket options are valid on TCP sockets. For more informa?
tion see ip(7).

TCP_NODELAY
Turn the Nagle algorithm off. This means that pack?
ets are always sent as soon as possible and no
unnecessary delays are introduced, at the cost of
more packets in the network. Expects an integer
boolean flag.

2001-12-18 16:03:15

by Alan

[permalink] [raw]
Subject: Re: Turning off nagle algorithm in 2.2.x and 2.4.x kernels?

> and 2.4.x kernels? For the same custom app used under Solaris and Linux.
> Turning off nagle algorithm boosted perf on Solaris, I tried commenting out

man setsockopt (Linux and Solaris)


2001-12-18 17:06:00

by Ahmed, Zameer

[permalink] [raw]
Subject: RE: Turning off nagle algorithm in 2.2.x and 2.4.x kernels?

Hi,

The finicky nature of closed sourced sybase libraries that we are using in
the custom apps make me ask this question. Will turning off the Nagle
algorithm in the kernel on the fly, impact performance in any way? or Can we
have this feature in the kernel in some way?

TIA
Zameer A.


-----Original Message-----
From: Alan Cox [mailto:[email protected]]
Sent: Tuesday, December 18, 2001 9:58 AM
To: [email protected]
Cc: [email protected]
Subject: Re: Turning off nagle algorithm in 2.2.x and 2.4.x kernels?


> and 2.4.x kernels? For the same custom app used under Solaris and Linux.
> Turning off nagle algorithm boosted perf on Solaris, I tried commenting
out

man setsockopt (Linux and Solaris)

2001-12-18 18:00:01

by Oliver Xymoron

[permalink] [raw]
Subject: RE: Turning off nagle algorithm in 2.2.x and 2.4.x kernels?

On Tue, 18 Dec 2001, Ahmed, Zameer wrote:

> The finicky nature of closed sourced sybase libraries that we are using in
> the custom apps make me ask this question. Will turning off the Nagle
> algorithm in the kernel on the fly, impact performance in any way? or Can we
> have this feature in the kernel in some way?

Nagle isn't there for looks, of course it will affect performance.

Considered LD_PRELOAD?

--
"Love the dolphins," she advised him. "Write by W.A.S.T.E.."

2001-12-18 19:02:04

by Alan

[permalink] [raw]
Subject: Re: Turning off nagle algorithm in 2.2.x and 2.4.x kernels?

> The finicky nature of closed sourced sybase libraries that we are using in
> the custom apps make me ask this question. Will turning off the Nagle
> algorithm in the kernel on the fly, impact performance in any way? or Can we
> have this feature in the kernel in some way?

Turning it off generically risks extremely bad network behaviour on a
congested link.