-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
podman create/run --shm-size doesn't work #1770
Comments
shm-size is used to modify the default size setting in the mount option. By default we mount at 64000k
Notice the mount point changed to 976564k |
This looks like a rootless thing, but I'm confused as to why, we should be
able to make tmpfs mounts in the rootless userns
…On Wed, Nov 7, 2018, 08:00 Daniel J Walsh ***@***.*** wrote:
# podman run --interactive --name foo1 --tty fedora mount | grep shm
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,context="system_u:object_r:container_file_t:s0:c162,c460",size=64000k)
shm-size is used to modify the default size setting in the mount option.
By default we mount at 64000k
# podman run --interactive --name foo --shm-size 1g --tty fedora mount | grep shm
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,context="system_u:object_r:container_file_t:s0:c761,c1021",size=976564k)
Notice the mount point changed to 976564k
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1770 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHYHCMvKc3Z5qE9wKiiEbCg-i_CLW0Haks5ustl-gaJpZM4YSWaH>
.
|
@mheon User NS Allows you to mount tmpfs as long as it is on a directory that you own. But maybe it does not allow you to set the size. |
@giuseppe Are we not using tmpfs mounted on /dev/shm inside of rootless containers? |
Yeah, this is when running rootless. It's not the end of the world because I can work around it with It has been trickier to mimic the in-kernel |
I do think this is a bug in podman, we should be using a tmpfs for this not physical disk. |
Rootless podman shuld mount a tmpfs at /dev/shm by default. Until that happens, it's worked around by explicitly specifying the mount point. Also, the --shm-size flag isn't working with rootless podman [1], so --tmpfs is used instead. It tries to mimic the in-kernel tmpfs default [2] of using half the amount of total RAM. If for some reason /proc/meminfo can't be parsed, it falls back to using podman's default of 65536k for tmpfs. It's not clear whether podman uses kibibytes or kilobytes for 'k'. The former was picked here for consistency. [1] containers/podman#1770 [2] https://www.kernel.org/doc/Documentation/filesystems/tmpfs.txt #9
Rootless podman shuld mount a tmpfs at /dev/shm by default. Until that happens, it's worked around by explicitly specifying the mount point. Also, the --shm-size flag isn't working with rootless podman [1], so --tmpfs is used instead. It tries to mimic the in-kernel tmpfs default [2] of using half the amount of total RAM. If for some reason /proc/meminfo can't be parsed, it falls back to using podman's default of 65536k for tmpfs. It's not clear whether podman uses kibibytes or kilobytes for 'k'. The former was picked here for consistency. [1] containers/podman#1770 [2] https://www.kernel.org/doc/Documentation/filesystems/tmpfs.txt #9
Rootless podman shuld mount a tmpfs at /dev/shm by default. Until that happens, it's worked around by explicitly specifying the mount point. Also, the --shm-size flag isn't working with rootless podman [1], so --tmpfs is used instead. It tries to mimic the in-kernel tmpfs default [2] of using half the amount of total RAM. If for some reason /proc/meminfo can't be parsed, it falls back to using podman's default of 65536k for tmpfs. It's not clear whether podman uses kibibytes or kilobytes for 'k'. The former was picked here for consistency. [1] containers/podman#1770 [2] https://www.kernel.org/doc/Documentation/filesystems/tmpfs.txt #9
there is a PR for this issue: #1777 |
Since this PR has been merged, I am going to close this issue. |
/kind bug
Description
While investigating why
/dev/shm
wasn't a tmpfs, I found thatpodman create --shm-size
orpodman run --shm-size
doesn't seem to work as advertised.Notice how the size of
/dev/shm
isn't 1G. In fact, it doesn't have any effect, because the result is the same without--shm-size
.I get similar results with
podman create
, which is what the Silverblue toolbox uses.(Why doesn't
podman
mount atmpfs
at/dev/shm
by default?)Output of
podman version
:Output of
podman info
:Additional environment details (AWS, VirtualBox, physical, etc.):
This is a physical laptop running Fedora 28 Silverblue 28.20181105.0, with
podman-0.10.1.3-3.gitdb08685.fc28
and2:runc-1.0.0-57.dev.git9e5aa74.fc28
overlaid on top.The text was updated successfully, but these errors were encountered: