From: Andrew Morton <akpm@linux-foundation.org>
To: Peter Palfrader <weasel@debian.org>
Cc: linux-kernel@vger.kernel.org, debian-admin@lists.debian.org,
team@security.debian.org, libpam-modules@packages.debian.org,
Adam Tkac <vonsch@gmail.com>,
stable@kernel.org
Subject: Re: 2.6.28, rlimits, performance and debian etch
Date: Tue, 27 Jan 2009 15:17:03 -0800 [thread overview]
Message-ID: <20090127151703.c356c5db.akpm@linux-foundation.org> (raw)
In-Reply-To: <20090121115219.GA2754@anguilla.noreply.org>
On Wed, 21 Jan 2009 12:52:19 +0100
Peter Palfrader <weasel@debian.org> wrote:
> Hi,
>
> I spent several hours trying to get to the bottom of a serious
> performance issue that appeared on one of our servers after upgrading to
> 2.6.28. In the end it's what could be considered a userspace bug that
> was triggered by a change in 2.6.28. Since this might also affect other
> people I figured I'd at least document what I found here, and maybe we
> can even do something about it:
>
>
> So, I upgraded some of debian.org's machines to 2.6.28.1 and immediately
> the team maintaining our ftp archive complained that one of their
> scripts that previously ran in a few minutes still hadn't even come
> close to being done after an hour or so. Downgrading to 2.6.27 fixed
> that.
>
> Turns out that script is forking a lot and something in it or python or
> whereever closes all the file descriptors it doesn't want to pass on.
> That is, it starts at zero and goes up to ulimit -n/RLIMIT_NOFILE and
> closes them all with a few exceptions.
>
> Turns out that takes a long time when your limit -n is now 2^20 (1048576).
>
> With 2.6.27.* the ulimit -n was the standard 1024, but with 2.6.28 it is
> now a thousand times that.
>
> 2.6.28 included a patch titled "rlimit: permit setting RLIMIT_NOFILE to
> RLIM_INFINITY" (0c2d64fb6cae9aae480f6a46cfe79f8d7d48b59f)[1] that
> allows, as the title implies, to set the limit for number of files to
> infinity.
>
> Closer investigation showed that the broken default ulimit did not apply
> to "system" processes (like stuff started from init). In the end I
> could establish that all processes that passed through pam_limit at one
> point had the bad resource limit.
>
> Apparently the pam library in Debian etch (4.0) initializes the limits
> to some default values when it doesn't have any settings in limit.conf
> to override them. Turns out that for nofiles this is RLIM_INFINITY.
> Commenting out "case RLIMIT_NOFILE" in pam_limit.c:267 of our pam
> package version 0.79-5 fixes that - tho I'm not sure what side effects
> that has.
>
> Debian lenny (the upcoming 5.0 version) doesn't have this issue as it
> uses a different pam (version).
>
>
> I'm a bit unsure where to go from here. Maybe the pam library in etch
> should be fixed. Maybe the patch should be reverted (but then it may be
> more correct now and that's what the changelog entry suggests).
> As a stopgap measure I could also just define nofile in limits.conf.
>
> Thanks for listening. Also thanks to Rik and Nocholas who helped track
> some of this down.
>
> Cheers,
> Peter
> 1. http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0c2d64fb6cae9aae480f6a46cfe79f8d7d48b59f
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=0c2d64fb6cae9aae480f6a46cfe79f8d7d48b59f
Ho hum, thanks.
Well, I think we just revert it for now. We can bring it back later
if someone is thus inclined. Along with some sort of opt-in control,
perhaps in /proc. Which defaults to "off".
next prev parent reply other threads:[~2009-01-27 23:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-21 11:52 2.6.28, rlimits, performance and debian etch Peter Palfrader
2009-01-23 21:07 ` Florian Weimer
2009-01-23 22:02 ` David Daney
2009-01-23 23:11 ` Peter Palfrader
2009-01-25 10:59 ` Florian Weimer
2009-01-27 23:17 ` Andrew Morton [this message]
2009-01-29 12:19 ` Adam Tkac
2009-01-29 18:05 ` Andrew Morton
2009-01-29 18:10 ` Peter Palfrader
2009-02-02 16:20 ` Adam Tkac
2009-02-08 22:31 ` Steve Langasek
-- strict thread matches above, loose matches on Subject: below --
2009-02-26 21:48 Frans Pop
2009-02-26 22:01 ` Steve Langasek
2009-02-27 7:30 ` Peter Palfrader
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=20090127151703.c356c5db.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=debian-admin@lists.debian.org \
--cc=libpam-modules@packages.debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@kernel.org \
--cc=team@security.debian.org \
--cc=vonsch@gmail.com \
--cc=weasel@debian.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.