Posts

Showing posts with the label fargate

Using AWS ECS Fargate Horizontal Auto Scaling

Image
Introduction In previous articles, I have provided instructions on using AWS ECS Fargate to deploy a NestJS Docker image utilizing S3 Service; you can review them to understand the basic concepts before proceeding. In this article, I will guide you through configuring auto scaling to automatically increase or decrease the number of instances based on demand. Prerequisites In the NestJS project, to easily test the auto-scaling feature, it is necessary to create an API with a relatively long processing time to drive CPU usage up during execution. I will create a simple API as follows for testing; you can add it to your project or replace it with any equivalent API of your choice. Afterward, build the Docker image and push it to AWS ECR. import {   Controller ,   Get ,   ParseIntPipe ,   Query , } from '@nestjs/common' @ Controller ( 'test' ) export class TestController {   @ Get ( 'sum' )   async sum (@ Query ( 'value' , ParseIntPipe ) value : number...

Guide to using AWS ECS Fargate

Image
Introduction AWS Elastic Container Service (ECS) Fargate is a "serverless" technology for containers, helping you run Docker applications without having to manage physical servers or EC2 virtual machine clusters. Normally, when running containers, you must choose the instance type, manage the operating system, and scale the server cluster. With Fargate, you simply package the application into a container, define CPU and memory requirements, and Fargate will automatically initialize and manage the underlying infrastructure. Key Advantages No infrastructure management: Eliminates operational burdens such as OS patching, server maintenance, or EC2 cluster management. High security: Each task runs in a separate execution environment, completely isolated from other tasks, helping to enhance security. Flexible scalability: Fargate automatically adjusts resources based on the actual needs of the application without worrying about cluster capacity shortages. Deep integration: Easily ...