Set up reserved ports for those used by agent on ECS AMI
- Dominant language
- Shell
- Stars
- 5.4k
- Forks
- 334
- PR merge metrics
- No merged PRs in 30d
Description
### Description
ECS optimized AMIs have the ip_local_port_range kernel parameter set to 32768-60999, however ECS agent needs port 51678 and 51679.
Custom daemon process may accidentally use port 51678 as ephemeral port, avoiding ECS agent to start properly.
```
$ sysctl net.ipv4.ip_local_port_range
net.ipv4.ip_local_port_range = 32768 60999
```
We have customers already run into this issue that the ports that using by agent have been taken so that agent cannot start.
One way that can probably solve this problems is to configure the reserved ports on the host to include those used by agent, so that custom processes will not be assigned to these ports.
```
$ sysctl net.ipv4.ip_local_reserved_ports
net.ipv4.ip_local_reserved_ports =
```
Above is just one proposal, there may be other ways. More research may be needed when we decide to work on this issue.
### Expected Behavior
Custom processes will not occupy the ports used by agent.
### Observed Behavior
Custom processes can occupy the ports used by agent.
### Environment Details
### Supporting Log Snippets
Contributor guide
Research direction
Start by investigating how ECS-optimized AMIs configure net.ipv4.ip_local_port_range and net.ipv4.ip_local_reserved_ports, and confirm where the ECS agent uses ports 51678 and 51679. Verify that reserving those ports prevents custom processes from taking them and allows the agent to start reliably; the issue does not mention specific files or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, linux
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100