Bug 1293502 - Docker spawns a docker-proxy process for each port in a container
Docker spawns a docker-proxy process for each port in a container
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: docker (Show other bugs)
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Antonio Murdaca
: Extras
Depends On:
  Show dependency treegraph
Reported: 2015-12-21 19:08 EST by wibrown@redhat.com
Modified: 2016-03-31 19:23 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-03-31 19:23:11 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description wibrown@redhat.com 2015-12-21 19:08:52 EST
Description of problem:
Docker spawns a docker-proxy process for each port in a container.

Consider the usage of asterisk in a container. This required the opening of hundreds, if not thousands of ports.

This can cause the docker host to crash.

docker run -it --rm=true --name porttest -p 3000-3010 busybox

In another shell:

ps ax | grep docker-proxy | egrep '30[0-9]{2}' | wc

Should yield 11 processes. If this is increased, such as:

docker run -it --rm=true --name porttest -p 3000-4000 busybox

Your docker host may destabilise, crash or freeze.

How reproducible:

Actual results:
Docker host crashes from the number of spawned processes

Expected results:
Docker host should not crash or freeze, and there should be one docker-proxy for each running container.
Comment 2 Mrunal Patel 2015-12-22 12:10:56 EST
Wasn't there an option to use iptables instead of the userland port proxy?
Comment 3 Antonio Murdaca 2015-12-22 14:26:34 EST
Enabling hairpin NAT via the daemon flag "--userland-proxy=false" prevents the daemon from spawning docker-proxy processes. This way the port mapping is achieved via just iptables (as Mrunal said).

Are there any reasons you can't disable userland-proxy? Could you try setting "--userland-proxy=false" and see if the daemon still has issues?
Comment 5 wibrown@redhat.com 2016-01-19 21:13:26 EST
I believe that using the iptables rules prevents container to container communication.
Comment 6 Antonio Murdaca 2016-01-20 04:22:49 EST
could you tell me how you reproduce the blocked container to container communication?
Comment 7 wibrown@redhat.com 2016-01-20 19:18:20 EST
Here is the information I was sent:

Well, to explain it better, take a host that's on, running a Docker container listening on port 5000 (in the container) that's exposed on port 800 on the host.  Assume that the first container's Docker IP is  Then, take another Docker container on the same host trying to connect to that exposed port;

APP=`docker run -d -p 800:5000/tcp training/webapp python app.py`
curl   # works, of course
docker run --rm -it image curl   # does not work
docker run --rm -it image curl   # does work
docker stop $APP
docker rm $APP

I haven't tried this myself yet however.
Comment 8 Luwen Su 2016-03-20 09:11:57 EDT
In docker-1.9.1-23.el7.x86_64, move to verified.

Just to be noted,
It's better not try `docker run -it --rm=true --name porttest -p 3000-4000 busybox` in  remote machine which used network is not strong enough.
Comment 10 errata-xmlrpc 2016-03-31 19:23:11 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.