[lxc-users] Limits kind of not working

Pavol Cupka pavol.cupka at gmail.com
Tue Sep 12 07:13:33 UTC 2017


Maybe I am doing it wrong.

lxc profile show def-disk20g
config: {}
description: Default LXD profile with root disk limit - 20 GB
devices:
  eth0:
    nictype: bridged
    parent: lxdbr0
    type: nic
  root:
    path: /
    pool: default
    size: 20GB
    type: disk
name: def-disk20g
used_by:
- /1.0/containers/c1

lxc storage list
+---------+-------------+--------+------------------------------------+---------+
|  NAME   | DESCRIPTION | DRIVER |               SOURCE
| USED BY |
+---------+-------------+--------+------------------------------------+---------+
| default |             | btrfs  | /var/lib/lxd/storage-pools/default
| 10      |
+---------+-------------+--------+------------------------------------+---------+


c1 ~ # dd if=/dev/zero of=/test.file
^C180675599+0 records in
180675599+0 records out
92505906688 bytes (93 GB) copied, 508.106 s, 182 MB/s

On Tue, Sep 12, 2017 at 8:58 AM, Serge E. Hallyn <serge at hallyn.com> wrote:
> Hm, sorry, I don't know.  As far as I know this should work.  Stéphane,
> any ideas?
>
> -serge
>
> On Tue, Sep 12, 2017 at 05:36:54AM +0000, Pavol Cupka wrote:
>> OK, thank you for your answer. So I can confirm CPU and memory limits
>> working. IO and network have to be tested on my part yet. What doesn't work
>> for me is disk "quota" I am using btrfs and I have set 20GB for the
>> container root, but was still able to allocate more the 90GB writing with
>> dd to a file inside the container. What am I doing wrong?
>>
>> Thank you in advance
>> Pavol
>>
>> On Mon, Sep 11, 2017 at 10:24 PM Serge E. Hallyn <serge at hallyn.com> wrote:
>>
>> > Quoting Pavol Cupka (pavol.cupka at gmail.com):
>> > > Hello list!
>> > >
>> > > I am running LXD on gentoo, but without systemd (with openrc). I have
>> > > trouble setting limits.cpu, limits.memory and disk size (using btrfs). I
>> > > haven't tried the network and io limits yet. The values for limits.cpu
>> > can
>> > > be found in /sys/fs/cgroup/cpuset/lxc/c1/cpuset.cpus for example, but
>> > > /proc/cpuinfo inside the container still shows all the processors.
>> >
>> > /proc/cpuinfo isn't virtualized to show only the cpus you have
>> > available.  For that you have to use lxcfs, which is a fuse filesystem
>> > that overmounts /proc and filters the results.
>> >
>> > github.com/lxc/lxcfs
>> >
>> > > LXC 2.0.8
>> > > LXD 2.16
>> > > CGMANAGER 0.41
>> > >
>> > > Thank you for any pointers.
>> > > Pavol
>> >
>> > > _______________________________________________
>> > > lxc-users mailing list
>> > > lxc-users at lists.linuxcontainers.org
>> > > http://lists.linuxcontainers.org/listinfo/lxc-users
>> >
>> > _______________________________________________
>> > lxc-users mailing list
>> > lxc-users at lists.linuxcontainers.org
>> > http://lists.linuxcontainers.org/listinfo/lxc-users
>
>> _______________________________________________
>> lxc-users mailing list
>> lxc-users at lists.linuxcontainers.org
>> http://lists.linuxcontainers.org/listinfo/lxc-users
>
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users


More information about the lxc-users mailing list