compose-cli icon indicating copy to clipboard operation
compose-cli copied to clipboard

Configuration option to use EC2 instead of Fargate in ECS

Open johan123312321 opened this issue 4 years ago • 6 comments

Description

Currently Fargate containers are used by default in ECS service. EC2 containers are supported but are used automatically only if GPU resources are requested.

There is no configuration option to manually force deployment to EC2 instead of Fargate.

Feature Request Please add configuration option which type of container (LaunchType) should be used for service (EC2 / FARGATE).

Justification In some architecture cases EC2 containers are preferred over Fargate from pricing perspective.

P.S. As I see from code there is function which decides which type of container should be created and it checks only gpu config.

func requireEC2(s types.ServiceConfig) bool { return gpuRequirements(s) > 0 }

johan123312321 avatar Mar 31 '21 21:03 johan123312321

EC2 support was introduced only to workaround lack of GPU support on Fargate, with the plan it would be removed once Fargate offer this option. From a technical perspective, EC2 support brings significant extra complexity that I'd prefer to avoid. I didn't know about pricing impacts, need to get a Product decision on this topic

ndeloof avatar Apr 01 '21 15:04 ndeloof

Hi,

we use EC2 launch types, because from a princing perspective they are more convenient when the workload does not scale often. In our use case for most of the time our services run in a fixed number of replicas, and only on fixed spike periods need to be scaled up.

Running the same configuration in FARGATE would be expensive, wihout any benefits.

Most of the benefit of FARGATE can be replicated using awsvpc and cloudmap, we tested it. And using the right ec2 instance. For a microservices scenario, we used a1.medium, that enabled us to run up 10 task defintion (derived from docker-compose) on just 2 GB of RAM.

From our perspective a limited support for EC2 ( some advanced features may be missing ) would be sufficient

davide-malagoli avatar Jun 23 '21 07:06 davide-malagoli

That's rally sad AWS doesn't make Fargate more attractive by pricing policy. I would expect Fargate allows better resource allocation/concentration and as such should offer lower costs vs plain dedicated EC2 instances.

ndeloof avatar Jun 23 '21 09:06 ndeloof

Hi. Is there any update on this? We also would like to specify EC2 instances for our launch configuration but there isn't any sort of option for it. Thanks!

jcharouel-nytimes avatar Oct 20 '21 18:10 jcharouel-nytimes

Fargate also only supports 4 CPUs and 30G memory, I have routine batch jobs that eat 36 CPUs and 72G memory.

knutster avatar Jan 26 '22 11:01 knutster

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 31 '22 03:07 stale[bot]

This issue has been automatically closed because it had not recent activity during the stale period.

stale[bot] avatar Aug 13 '22 06:08 stale[bot]

I would also like to use this feature, it is a dealbreaker forcing me to use other tools.

In my scenario, we have around 8 containers (microservices) we are wanting to run that would all fit nicely on a very cheap t4g.nano costing around $3 per month. For the same containers to run on Fargate this would cost orders of magnitude more with no benefits.

Is it possible to reconsider the addition of EC2 support?

Jaffa-Cakes avatar Apr 24 '23 12:04 Jaffa-Cakes