{"action":"opened","issue":{"url":"https://api.github.com/repos/moby/moby/issues/34328","repository_url":"https://api.github.com/repos/moby/moby","labels_url":"https://api.github.com/repos/moby/moby/issues/34328/labels{/name}","comments_url":"https://api.github.com/repos/moby/moby/issues/34328/comments","events_url":"https://api.github.com/repos/moby/moby/issues/34328/events","html_url":"https://github.com/moby/moby/issues/34328","id":246785198,"number":34328,"title":"Plenty of memory consumed when using a port range","user":{"login":"boldt","id":750793,"avatar_url":"https://avatars3.githubusercontent.com/u/750793?v=4","gravatar_id":"","url":"https://api.github.com/users/boldt","html_url":"https://github.com/boldt","followers_url":"https://api.github.com/users/boldt/followers","following_url":"https://api.github.com/users/boldt/following{/other_user}","gists_url":"https://api.github.com/users/boldt/gists{/gist_id}","starred_url":"https://api.github.com/users/boldt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boldt/subscriptions","organizations_url":"https://api.github.com/users/boldt/orgs","repos_url":"https://api.github.com/users/boldt/repos","events_url":"https://api.github.com/users/boldt/events{/privacy}","received_events_url":"https://api.github.com/users/boldt/received_events","type":"User","site_admin":false},"labels":[{"id":616332869,"url":"https://api.github.com/repos/moby/moby/labels/version/17.06","name":"version/17.06","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-07-31T14:55:56Z","updated_at":"2017-07-31T14:55:56Z","closed_at":null,"body":"**Description**\r\n\r\nPlenty of memory is consumed, when`docker run` is used with a a port range.\r\n\r\n**Steps to reproduce the issue:**\r\n\r\nI observed, that docker consumes a lot of memory when a port range is opened. As an example, I am using the following coturn server image:\r\n\r\n* https://github.com/anastasiia-zolochevska/turn-server-docker-image\r\n* https://github.com/anastasiia-zolochevska/turn-server-docker-image\r\n\r\nBasically it is an Ubuntu 16.04 with coturn installed. First, I ran the container as described in the README:\r\n\r\n```\r\nsudo docker run \\\r\n  -d \\\r\n  --restart=always \\\r\n  --name coturn \\\r\n  -p 3478:3478 \\\r\n  -p 3478:3478/udp \\\r\n  zolochevska/turn-server username password realm\r\n```\r\n\r\nThis consumes approx. 8 MB memory (comparing `free -h` before and after `doccker run`)\r\n\r\n**Background (how TURN works)**: In the moment a TURN server receives a bind request, it binds a (random) UDP port. In case of coturn it is a port in the range 49152-65535. Thus, it is needed to publish this port range as well. \r\n\r\nThus I ran the contaner as above with more and more published UDP ports (see below).\r\n\r\n**Describe the results you received:**\r\n\r\n| Port range                     | #ports | memory  |\r\n|--------------------------------|--------|---------|\r\n| -p 65435-65535:65435-65535/udp |  100   | 116 MB  |\r\n| -p 65035-65535:65035-65535/udp |  500   | 602 MB  |\r\n| -p 64035-65535:64035-65535/udp | 1500   | 1,6 GB  |\r\n\r\nI can say, that every UDP port consumes approx. 1 MB memory. Opening the whole port range for coturn (65535-49152 = 16383 ports)  means, that 16GB of memory will be needed, \r\n\r\nThat seems to be to much for me.\r\n\r\n**Describe the results you expected:**\r\n\r\nMuch less memory consumed when publishing a port range.\r\n\r\n**Additional information you deem important (e.g. issue happens only occasionally):**\r\n\r\n**Output of `docker version`:**\r\n\r\n```\r\nClient:\r\n Version:      17.06.0-ce\r\n API version:  1.30\r\n Go version:   go1.8.3\r\n Git commit:   02c1d87\r\n Built:        Fri Jun 23 21:23:31 2017\r\n OS/Arch:      linux/amd64\r\n\r\nServer:\r\n Version:      17.06.0-ce\r\n API version:  1.30 (minimum version 1.12)\r\n Go version:   go1.8.3\r\n Git commit:   02c1d87\r\n Built:        Fri Jun 23 21:19:04 2017\r\n OS/Arch:      linux/amd64\r\n Experimental: false\r\n```\r\n\r\n**Output of `docker info`:**\r\n\r\n```\r\nContainers: 2\r\n Running: 1\r\n Paused: 0\r\n Stopped: 1\r\nImages: 4\r\nServer Version: 17.06.0-ce\r\nStorage Driver: aufs\r\n Root Dir: /var/lib/docker/aufs\r\n Backing Filesystem: extfs\r\n Dirs: 23\r\n Dirperm1 Supported: true\r\nLogging Driver: json-file\r\nCgroup Driver: cgroupfs\r\nPlugins: \r\n Volume: local\r\n Network: bridge host macvlan null overlay\r\n Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog\r\nSwarm: inactive\r\nRuntimes: runc\r\nDefault Runtime: runc\r\nInit Binary: docker-init\r\ncontainerd version: cfb82a876ecc11b5ca0977d1733adbe58599088a\r\nrunc version: 2d41c047c83e09a6d61d464906feb2a2f3c52aa4\r\ninit version: 949e6fa\r\nSecurity Options:\r\n apparmor\r\n seccomp\r\n  Profile: default\r\nKernel Version: 4.4.0-83-generic\r\nOperating System: Ubuntu 16.04.2 LTS\r\nOSType: linux\r\nArchitecture: x86_64\r\nCPUs: 2\r\nTotal Memory: 3.859GiB\r\nName: docker-4gb-fra1-01\r\nID: FELR:B6QG:6QUV:MMRL:KVJ5:E234:B5Q7:36RC:SGJ6:4VKA:CYJZ:NX4F\r\nDocker Root Dir: /var/lib/docker\r\nDebug Mode (client): false\r\nDebug Mode (server): false\r\nRegistry: https://index.docker.io/v1/\r\nExperimental: false\r\nInsecure Registries:\r\n 127.0.0.0/8\r\nLive Restore Enabled: false\r\n```\r\n\r\n**Additional environment details (AWS, VirtualBox, physical, etc.):**\r\n\r\nI used the Digitalocean one-click app *Docker 17.06.0-ce on 16.04* with 4 GB of ram."}}
{"actor":{"display_login":"boldt"}}