[lxc-users] Mounting huge pages on a conatiner
Serge Hallyn
serge.hallyn at ubuntu.com
Tue Sep 23 17:37:24 UTC 2014
Quoting Murthy, Krishna J (krishna.j.murthy at intel.com):
> > I use Huge Pages inside a container routinely, for Mysql. I had to change
> > /etc/sysctl.conf inside the container.
> > that lines I included are
> > kernel.shmall = 4294967296
> > kernel.shmmax = 68719476736
> > basically you need to make huge pages available in the host first, and
> > they will be available in the container
>
> Ok. In this case we are allocating the shared memory. How do we make this memory
> visible for apps that expect it be mounted as hugetlbfs.
>
> root at vc0:~# df -lh
> Filesystem Size Used Avail Use% Mounted on
> /dev/root 50G 7.6G 39G 17% /
> none 16G 0 16G 0% /dev/shm
>
> root at vc0:~# cat /proc/sys/vm/nr_hugepages
> 5
Bind mount it to wherever your application expects to see it?
I.e.
lxc.mount.entry = /run/hugepages/kvm run/hugepages/kvm none bind,create=dir 0 0
More information about the lxc-users
mailing list