public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nivedita Singhvi <niv@us.ibm.com>
To: hayden@spinbox.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.2 to 2.4... serious TCP send slowdowns
Date: Fri, 19 Jul 2002 13:09:46 -0700	[thread overview]
Message-ID: <1027109386.3d38720ad79f5@imap.linux.ibm.com> (raw)

> We're finally migrating to the 2.4 kernel due to hardware
> incompatibilities with the 2.2.  The 2.2 has worked better
> for us in the past as far as our application performs.
> Our application is an adserver and becomes bogged down in 2.4
> when sending files such as images across

When you say bogged down, what exactly does that mean? Does it
hang? Can you quantify the slowdown with any measurements?
Have you looked at TCP and network statistics to check for
timeouts, drops, other errors, the like? netstat -s should
give you some extended TCP stats which might help you diagnose
that sort of problem..

> the wire.  They're in general between 20-50k in size.  I've been
> researching the differences between 2.4 and 2.2 and have noticed
> that a lot of work has gone into autotuning with 2.4 and I'm
> wondering if this is what's slowing things down.  When I do tcpdumps
> to see the traffic being sent to the client I'm noticing that the
> receiver window is almost always set to 6430 bytes.  When looking at
> the same transfer on our 2.2 boxes the receiver window is almost
> always over 31000 bytes.  I've tried to increase the size of the
> buffers using the proc settings that are provided however

Whats your interface MTU? How did you change the size of the buffers?
Note that you need to increase the tcp_rmem[1] and tcp_wmem[1] to
affect the default tcp socket buffer sizes. Also note that
approximately half that is used by the kernel, so if you really want
64K user space, try setting the size to 128K.

> this hasn't seemed to make a difference even after restarting
> servers after each change the window is still 6430 bytes.  I've
> tried manually settting the size with setsockopt calls in the server
> code but this hasn't seemed to help.  I believe the problem is
> definately with sending the files over the line.  We files are read
> into the socket to be sent across the network byte by byte.  The boss
> says this is the best way to do it but I'm curious if this is so.

You cant optimize your read() from a fd and writes to a socket fd()
simultaneously. Are you setting TCP_NODELAY?

If all you are doing is reading large files from disk and sending them
out over a socket, consider using sendfile() instead. Much more
efficient.

thanks,
Nivedita





             reply	other threads:[~2002-07-19 20:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-19 20:09 Nivedita Singhvi [this message]
     [not found] <Pine.LNX.4.10.10207221646120.4476-100000@compaq.skyline.net>
2002-07-22 21:43 ` 2.2 to 2.4... serious TCP send slowdowns Mika Liljeberg
     [not found] <Pine.LNX.4.10.10207221603340.4476-100000@compaq.skyline.net>
2002-07-22 20:32 ` Mika Liljeberg
  -- strict thread matches above, loose matches on Subject: below --
2002-07-18 23:30 2.2 to 2.4 migration Hayden Myers
2002-07-19 17:04 ` 2.2 to 2.4... serious TCP send slowdowns Hayden Myers
2002-07-20 20:53   ` Alan Cox
2002-07-22 18:47     ` Hayden Myers
2002-07-22 19:51       ` Mika Liljeberg
2002-07-23  7:24       ` Buddy Lumpkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1027109386.3d38720ad79f5@imap.linux.ibm.com \
    --to=niv@us.ibm.com \
    --cc=hayden@spinbox.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox