From: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
To: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Subject: Re: Checking memory limit inside a container
Date: Thu, 19 Apr 2012 10:24:19 +0900 [thread overview]
Message-ID: <4F8F6943.5020304@jp.fujitsu.com> (raw)
In-Reply-To: <CAPE4pjBNqeBXqUTpfnY1UyB13H0fKUiKaLW_HL0uWsrLTJ62mA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
(2012/04/19 8:13), Matt Chapman wrote:
> Hello,
>
> I'm new to using LXC, but really impressed so far. I'm trying to set-up
> memory limits for a container, and have added these lines to my container
> config file:
>
> lxc.cgroup.memory.limit_in_bytes = 15872M
> lxc.cgroup.memory.memsw.limit_in_bytes = 16896M
>
> ...and I've stopped & restarted my container.
>
> But from inside the container, using `free` or `top`,etc, still reports the
> total available memory as that of the host system, not what has been
> allocated to the container.
>
Yes, now, usual commands see /proc/meminfo, it's not virtualized yet.
We have plans but...it's not implemented yet.
> Is this normal, or does it suggest I did something wrong? Is there a way to
> accurately check memory usage for a container from within that container?
> Or even from the host system?
>
IIUC, the only way we have is
# cat /path-to-cgroup/memory.usage_in_bytes
# cat /path-to-cgroup/memory.stat
Or you can use some libcgroup commands as cgget...
I'm sorry if I don't know existing useful lxc memory checker.
Thanks,
-Kame
prev parent reply other threads:[~2012-04-19 1:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-18 23:13 Checking memory limit inside a container Matt Chapman
[not found] ` <CAPE4pjBNqeBXqUTpfnY1UyB13H0fKUiKaLW_HL0uWsrLTJ62mA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-04-19 1:24 ` KAMEZAWA Hiroyuki [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=4F8F6943.5020304@jp.fujitsu.com \
--to=kamezawa.hiroyu-+cum20s59erqfuhtdcdx3a@public.gmane.org \
--cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.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.