From: Mike Galbraith <efault@gmx.de>
To: Martin Baum <pop3@flachtaucher.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: cgroups: Assigning tasks to a cgroup slow and does not scale
Date: Sat, 04 Jun 2011 12:10:31 +0200 [thread overview]
Message-ID: <1307182231.25172.34.camel@marge.simson.net> (raw)
In-Reply-To: <20110604102343.113667vdxn02i4ws@webmail.df.eu>
On Sat, 2011-06-04 at 10:23 +0200, Martin Baum wrote:
> Hello,
>
> assigning a task to new cgroup takes an unexpected high amount of time
> on my system - about 0.05s. Strangely it does it does not scale with
> more processes: When I run 10 processes that do nothing but change
> their cgroups each cgroup change takes about 0.5 seconds while CPU
> usage remains very low. So my system maxes out at 20 cgroup changes
> per second while cpu and disk usage remain minimal (according to top).
> Is this expected behaviour?
Attaching a task invokes synchronize_rcu() along the way, so yup, it's
the expected behavior.
> It is a problem for me: I run a daemon that forks and calls suid for
> each request. I want to assign each of these forks to a different
> cgroup. However this currently kills performance going down from >100
> req/sec to about 20 req/sec.
You can work around it via static cgroups with an agent waiting inside
each one. Tell your agent what to do, he forks off a worker. You can
inherit a cgroup quickly, but moving between cgroups is very expensive,
as you noticed.
(right way is eventually stop exporting rcu grace periods to userland)
-Mike
prev parent reply other threads:[~2011-06-04 10:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-04 8:23 Martin Baum
2011-06-04 10:10 ` Mike Galbraith [this message]
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=1307182231.25172.34.camel@marge.simson.net \
--to=efault@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=pop3@flachtaucher.de \
/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
all inboxes | Powered by JetHome®