All of lore.kernel.org
 help / color / mirror / Atom feed
* Checking memory limit inside a container
@ 2012-04-18 23:13 Matt Chapman
       [not found] ` <CAPE4pjBNqeBXqUTpfnY1UyB13H0fKUiKaLW_HL0uWsrLTJ62mA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Matt Chapman @ 2012-04-18 23:13 UTC (permalink / raw)
  To: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

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.

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?

Any help would be greatly appreciated.

Thanks,

Matt Chapman

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Checking memory limit inside a container
       [not found] ` <CAPE4pjBNqeBXqUTpfnY1UyB13H0fKUiKaLW_HL0uWsrLTJ62mA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-04-19  1:24   ` KAMEZAWA Hiroyuki
  0 siblings, 0 replies; 2+ messages in thread
From: KAMEZAWA Hiroyuki @ 2012-04-19  1:24 UTC (permalink / raw)
  To: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

(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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-04-19  1:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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.