Skip to content
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

Shrink dynamic port range #2856

Merged
merged 2 commits into from Jul 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion nomad/structs/network.go
Expand Up @@ -12,7 +12,7 @@ const (
MinDynamicPort = 20000

// MaxDynamicPort is the largest dynamic port generated
MaxDynamicPort = 60000
MaxDynamicPort = 32000

// maxRandPortAttempts is the maximum number of attempt
// to assign a random port
Expand Down
14 changes: 14 additions & 0 deletions website/source/guides/cluster/requirements.html.md
Expand Up @@ -72,3 +72,17 @@ port.

* Serf WAN (Default 4648). This is used by servers to gossip over the WAN to
other servers. TCP and UDP.

When tasks ask for dynamic ports, they are allocated out of the port range
between 20,000 and 32,000. This is well under the ephemeral port range suggested
by the [IANA](https://en.wikipedia.org/wiki/Ephemeral_port). If your operating
system's default ephemeral port range overlaps with Nomad's dynamic port range,
you should tune the OS to avoid this overlap.

On Linux this can be checked and set as follows:

```
$ cat /proc/sys/net/ipv4/ip_local_port_range
32768 60999
$ echo "49152 65535" > /proc/sys/net/ipv4/ip_local_port_range
```