On Thu, Jun 1, 2017 at 11:42 PM, Denis Bozhok <[email protected]> wrote:
> Hello! > There is some strange problem. > When I'm typing "free" on the host, I've got a result: > > free -g > total used free shared buff/cache > available > Mem: 251 26 15 0 210 > 224 > Swap: 0 0 0 > > But when I'm executing it inside the container on this host the result is > different: > > free -g > total used free shared buffers cached > Mem: 251 234 17 0 0 0 > -/+ buffers/cache: 234 17 > Swap: 0 0 0 > > > What were you expecting? Short version: That is the correct behavior. Long version: By default, each container maintains its own process list (and mounts, and network stack, and others. search for "linux namespaces" for details). The host can see all processes, but each container can only see its own processes. Each container can be configured to either be able to use up-to-all available host memory, or limited to a certain ammount using cgroup limits. lxcfs provides a "fake" interface to some system files (e.g. /proc/meminfo) so that "classic" tools (e.g. top, free) can show "sane" values depending on their cgroup limits. -- Fajar
_______________________________________________ lxc-users mailing list [email protected] http://lists.linuxcontainers.org/listinfo/lxc-users
