[Lxc-users] Linux Mint and cgroups on /sys/fs/cgroup or /dev/cgroup/cpu

Michael H. Warfield mhw at WittsEnd.com
Mon Aug 12 15:57:56 UTC 2013


On Mon, 2013-08-12 at 15:02 +0200, arjan wrote: 
> Hi,

> This seems a list of lxc users only right? Anybody reading and replying 
> here that actually knows about the nitty-gritty of lxc?

No not quite.  Some of us are devs.  Originally, we only had the -dev
list.  Daniel created this list at my request years ago just so we could
improve the signal to noise ratio for BOTH users and devs.  The users
are often not interested in the dev nitty gritty and the devs were
starting to get overwhelmed and distracted by some of the simple user
requests.  So we split the lists.  Some of us do follow both.  Daniel
gets pretty snowed under even for the devel list so he doesn't pay a lot
of attention here.  Serge pays a bit of attention and I haunt it when I
can.

> To report back on how I more or less solved this issue: I simply 
> commented out the entry in /etc/bash.bashrc. Of course this is not the 
> ideal approach, because the performance goes down as was shown in the 
> link I mailed.

Sorry, I'm not a Linux Mint user.  I do some Fedora, RHEL, CentOS, plus
some Ubuntu and Debian.  I'm a total neophite wrt Mint and had not been
following the thread.

> Kind regards,
> Arjan Widlak.

> On 08/08/2013 12:15 AM, Arjan Widlak wrote:
> > Hi,
> >
> > I'm using Linux Mint and have the same problem as described in this post:
> >
> > http://osdir.com/ml/lxc-chroot-linux-containers/2012-03/msg00130.html
> >
> > On Linux Mint this entry is in /etc/bash.bashrc:
> >
> > if [ "$PS1" ] ; then
> >      mkdir -p -m 0700 /dev/cgroup/cpu/user/$$ > /dev/null 2>&1
> >      echo $$ > /dev/cgroup/cpu/user/$$/tasks
> >      echo "1" > /dev/cgroup/cpu/user/$$/notify_on_release
> > fi

That's a very bad location for cgroups to be mounted.  A decision was
made some time ago, and not everyone agrees with it, but cgroups should
be mounted on /sys/fs/cgroup.  They created a mount point in the kernel
sysfs (/sys) file system specifically for this.

> > The reason for this entry in Linux Mint is probably this:

> > http://www.webupd8.org/2010/11/alternative-to-200-lines-kernel-patch.html

Oh, that is very very old.  Even at 3 years old, however, you will
notice they reference /sys/fs/cgroup.  That is the standard now and has
been for quite a while.

> > Of course I can mount cgroups on /sys/fs/cgroup. And after that I can
> > start a container. However I get these errors on my terminal:

> > bash: /dev/cgroup/cpu/user/3855/tasks: No such file or directory
> > bash: /dev/cgroup/cpu/user/3855/notify_on_release: No such file or directory
> >
> > What is the best approach here?
> > The lxc-checkconfig script finds cgroups mounted when it's mounted on
> > /dev/cgroup/cpu, but lxc-start does not.

What version of lxc?  The latest version (0.9.0) certainly should as I'm
using it and systemd on Fedora mandates where cgroups is going to be
mounted.  If you're still running on 0.7.5 or earlier, that's probably
your real problem.

> > In linux-vserver the location of the cgroup mount can be configured. Can
> > it with lxc?

Where cgroups are mounted are an external issue to LXC.  Newer versions
of LXC should adapt to where cgroups are mounted and whether they are
mounted in a flat name space or a hierarchy (as established by libvirt
and by systemd).  The convention and the current gold standard
is /sys/fs/cgroup in a hierarchy and you will need a recent version of
the LXC utils.

I'm actually surprised linux-vserver is still around.  I abandoned that
project years ago after they broke IPv6 and went to OpenVZ for several
years before migrating to LXC so I wasn't having to install out-of-date
custom patched kernels all the time.  I can't even get the linux-vserver
mailing list server to respond to my subscription or information
requests, so I assumed it was just plain dead.  I guess I was wrong.

> > Kind regards,
> > Arjan Widlak.
> >
> > ------------------------------------------------------------------------------
> > Get 100% visibility into Java/.NET code with AppDynamics Lite!
> > It's a free troubleshooting tool designed for production.
> > Get down to code-level detail for bottlenecks, with <2% overhead.
> > Download for free and get started troubleshooting in minutes.
> > http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
> > _______________________________________________
> > Lxc-users mailing list
> > Lxc-users at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/lxc-users
> 
> 
> -- 
> Met vriendelijke groet,
> Arjan Widlak
> 
> Bezoek onze site op:
> http://www.unitedknowledge.nl
> 
> De rijkshuisstijl, ook voor tablet en iPhone:
> http://www.rijkshuisstijl.unitedknowledge.nl/
> 
> United Knowledge, inhoud en techniek
> Bilderdijkstraat 79N
> 1053 KM Amsterdam
> T +31 (0)20 737 1851
> F +31 (0)84 877 0399
> bureau at unitedknowledge.nl
> http://www.unitedknowledge.nl
> 
> M +31 (0)6 2427 1444
> E arjan at unitedknowledge.nl
> 
> We use WebGUI, the Open Source CMS
> http://www.webgui.org/

Regards,
Mike
-- 
Michael H. Warfield (AI4NB) | (770) 985-6132 |  mhw at WittsEnd.com
   /\/\|=mhw=|\/\/          | (678) 463-0932 |  http://www.wittsend.com/mhw/
   NIC whois: MHW9          | An optimist believes we live in the best of all
 PGP Key: 0x674627FF        | possible worlds.  A pessimist is sure of it!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 482 bytes
Desc: This is a digitally signed message part
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20130812/7da2fe58/attachment.pgp>


More information about the lxc-users mailing list