In some ECS environments, you may notice that container instances appear underutilized even though there are no placement constraints or strategies in the task or service definition. This often results in one task running per node, causing inefficient resource usage and higher operational costs. This article explains how the hostPort setting in ECS workloads can lead to this condition and provides steps to prevent it.
Review the ECS task or service definition for the portMappings section. Check the value of hostPort in each container's configuration:
-
If
hostPortis either blank or set to0, multiple tasks can be placed on the same container instance without issue. -
If
hostPortequalscontainerPort, each task will require a unique host port assignment. This results in one task per node, preventing bin packing and triggering unnecessary scale-ups.
Example configuration causing underutilization
"portMappings": [
{
"protocol": "tcp",
"hostPort": 443,
"containerPort": 443
}
]
Solution
-
Update the task definition so
hostPortis left blank or set to0unless a specific port binding to the host is required for your use case. -
Verify all containers in the task definition because multiple containers may define separate
portMappings.
Outcome
Adjusting the hostPort configuration enables ECS to bin pack tasks efficiently, reducing the number of container instances and improving cost optimization.
Learn More
Related Articles
Can hostPort settings cause underutilized ECS nodes? 3Number of Views Fix unregistered ECS container instances 2Number of Views Snow Commander vmware‑proxy startup failure caused by incorrect keystore password 6Number of Views Resolve Okta domain verification errors caused by IDP regex limits 7Number of Views Pods with hostPort requests cause underutilized nodes 4Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Revenera Assistant
Case id: 00001065
Activity: Status change: 2 hours ago