hackoregon / civic-devops

Master collection point for issues, procedures, and code to manage the HackOregon Civic platform
MIT License
11 stars 4 forks source link

Figure out the correct Cpu and Memory parameters for Fargate containers' ContainerDefinitions and TaskDefinition #256

Closed MikeTheCanuck closed 4 years ago

MikeTheCanuck commented 4 years ago

In the Fargate container YAMLs there are Cpu and Memory parameters in two sections:

Currently these are both configured to the same value. There's a good chance these don't need to be configured to the same values, and that we could save some $$ by using differing values.

Need to understand what these actually control, and determine what appropriate values should be for both our staging and production deploys.

MikeTheCanuck commented 4 years ago

Resolved by https://github.com/hackoregon/hackoregon-aws-infrastructure/pull/81

MikeTheCanuck commented 4 years ago

Summary:

Given that we currently allocate only one Container per Task, setting the same values (using the TaskCpu and TaskMemory variables throughout) at both the Task and Container level is sufficient and completely supported.

When and if we start grouping containers into Tasks (if that's even possible, given the container-level unique configurations we have), we can refactor as necessary.

(Note: grouping Containers into Tasks seems more appropriate when you have complementary containers all contributing to a single coordinated workload - e.g. an API container and a dependent database container, or two microservices that perform coupled operations. It doesn't make as much sense in practice - at least not for the Hack Oregon model - as it might for more highly-coupled, complex container architectures.)