All of lore.kernel.org
 help / color / mirror / Atom feed
From: steve roussey <iamstever@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: Question about SO_LINGER
Date: Wed, 10 Aug 2005 17:50:38 -0700	[thread overview]
Message-ID: <57792e85050810175041d2bad4@mail.gmail.com> (raw)

In a conversation the other yesterday about web servers, this came up
in conversation by another much more informed than I. I'm not sure if
the information is up to date to current kernel builds, so I pose the
question here: Does the linux kernel block on SO_LINGER?

Here is paragraph in the other conversation:

"The big problem is that most operating systems, for reasons I have never
understood, block on the close when SO_LINGER is set on it.  I always
thought that made absolutely no sense and is something the damn kernel's
stack should just take care of, but it doesn't, and you end up sitting
around twiddling your thumbs in userspace waiting for the lingering
socket to shut down.  Apache has a workaround called lingering_close()
that tries to address broken SO_LINGER implementations, but it also blocks."

I was guessing (but did not ask) that this information came from
apache so I grabbed this from apache's comments:

 * In an ideal world, this function would be accomplished by simply
 * setting the socket option SO_LINGER and handling it within the
 * server's TCP stack while the process continues on to the next request.
 * Unfortunately, it seems that most (if not all) operating systems
 * block the server process on close() when SO_LINGER is used.
 * For those that don't, see USE_SO_LINGER below.  For the rest,
 * we have created a home-brew lingering_close.

But when I looked at when this was added, it was around Apache 1.2
(and it references problems with Linux 2.0.31 -- that is has SO_LINGER
but it is faster/better to not use it). Apache 2.x has all of Apache
1.x's comments about this, though their implementation is different
and doesn't match. I'm going to ask them when I get a definitive
answer here.

Thanks,
-steve--

             reply	other threads:[~2005-08-11  0:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-11  0:50 steve roussey [this message]
2005-08-11  1:20 ` Question about SO_LINGER David S. Miller
2005-08-14  0:22 ` dean gaudet

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=57792e85050810175041d2bad4@mail.gmail.com \
    --to=iamstever@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.