Skip to content
This repository has been archived by the owner on May 6, 2021. It is now read-only.

Problems with large port range binding #3

Closed
Ezwen opened this issue Feb 12, 2019 · 3 comments
Closed

Problems with large port range binding #3

Ezwen opened this issue Feb 12, 2019 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@Ezwen
Copy link

Ezwen commented Feb 12, 2019

I've tried the first command of the README:

docker run -d -p 3478:3478 -p 49152-65535:49152-65535/udp instrumentisto/coturn

But then I've encountered some problems due to trying to bind a large range of ports to a Docker container. By default Docker uses a userland proxy (userland-proxy=true in the docker daemon), which tends to eat a huge amount of RAM and CPU when large amounts of ports are binded (see moby/moby#11185).

Unfortunately, I also reach problems when disabling userland proxy (userland-proxy=false), which makes docker use iptables instead of spawning tons of proxy listening processes. Here, not only does creating the container takes forever, but in my case it eventually fails creating all the required redirections and gives an error on a port being already in use (while it's not the case).

This overall problem is nicely summarized in this post: https://www.engagespark.com/blog/rtp-port-ranges-for-freeswitch-in-docker (except for the last problem I've encountered)


In summary: this is not a bug in your image, this is a big weakness of Docker unable to satisfyingly handle large port ranges :). In case you had not encountered this problem, I just wanted to share this piece of information. And maybe a word on these issues could be given in the README, but this is up to you.

and thanks for your work on this image!

@tyranron tyranron self-assigned this Feb 12, 2019
@tyranron tyranron added the question Further information is requested label Feb 12, 2019
@tyranron
Copy link
Member

@Ezwen thank you for paying attention!

As for us, we're using --network=host for WebRTC/TURN/STUN and don't bother. I think we can mention this in README.md.

@Ezwen
Copy link
Author

Ezwen commented Feb 13, 2019

I ended up doing the same (--network=host), even though I would really prefer to keep sandboxing my containers. But I'll have to make an exception for this one :)

Yes advising to use --network=host in the README would be nice I think!

@tyranron
Copy link
Member

cc @targs08 would you be so kind to add this mention there?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants