Skip to content

Addition of "--shm-size" not working with Docker 1.11.0 and Debian 8 Jessie #24040

Closed

Description

@kopax

--shm-size=512m is not working for me as build args, either as run args.

            docker run -it --shm-size=102400 ubuntu:14.04.4
    root@141a66888d0a:/# cat /proc/mounts | grep shm
    shm /dev/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=100k 0 0
    root@141a66888d0a:/# ipcs -lm

    ------ Shared Memory Limits --------
    max number of segments = 4096
    max seg size (kbytes) = 32768
    max total shared memory (kbytes) = 8388608
    min seg size (bytes) = 1

Install details

    docker version
    Client:
     Version:      1.11.0
     API version:  1.23
     Go version:   go1.5.4
     Git commit:   4dc5990
     Built:        Wed Apr 13 18:17:17 2016
     OS/Arch:      linux/amd64

    Server:
     Version:      1.11.0
     API version:  1.23
     Go version:   go1.5.4
     Git commit:   4dc5990
     Built:        Wed Apr 13 18:17:17 2016
     OS/Arch:      linux/amd64


    uname -a
    Linux master-bhs-01 3.14.32-xxxx-grs-ipv6-64 #7 SMP Wed Jan 27 18:05:09 CET 2016 x86_64 GNU/Linux

I was trying to configure multiple postgresql < 9.3 database at once. issue

For reference #16168

Activity

  1. justincormack commented on Jul 4, 2016

    @justincormack
    Contributor

    The --shm-size only affects the size of the /dev/shm mount, which is used for the posix shared memory APIs, not the sysv shared memory that ipcs shows. These limits need to be set with sysctl. In docker 1.12 there is a --sysctl parameter to docker run that can be used to set these, eg docker run --sysctl kernel.shmmni=8192 ubuntu ipcs -lm. However for recent Postgres you do want to set the posix shm size, which works fine, as this is what it uses, not the sysv shared memory:

    whale:cpp justin$ docker run -it --shm-size=512K ubuntu cat /proc/mounts | grep shm
    shm /dev/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=512k 0 0
    whale:cpp justin$ docker run -it --shm-size=100K ubuntu cat /proc/mounts | grep shm
    shm /dev/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=100k 0 0
    whale:cpp justin$ docker run -it --shm-size=102400 ubuntu cat /proc/mounts | grep shm
    shm /dev/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=100k 0 0
    
  2. thaJeztah commented on Jul 6, 2016

    @thaJeztah
    Member

    I'll close this issue, as it looks there's no bug here, but feel free to continue the discussion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions