Posts

Showing posts with the label Amazon Ecs

Auto Scale Fargate Service Based On SQS ApproximateNumberOfMessagesVisible

Answer : Yes you can do this. You have to use a step scaling policy, and you need to have an alarm created already for your SQS queue depth (ApproximateNumberOfMessagesVisible). Go to CloudWatch, create a new alarm. We'll call this alarm sqs-queue-depth-high , and have it trigger when the approximate number of messages visible is 1000. With that done, go to ECS to the service you want to autoscale. Click Update for the service. Add a scaling policy and choose the Step Tracking variety. You'll see there's an option to create a new alarm (which only lets you choose between CPU or MemoryUtilization), or use an existing alarm. Type sqs-queue-depth-high in the "Use existing alarm" field and press enter, you should see a green checkmark that lets you know the name is valid (i.e. the alarm exists). You'll see new dropdowns where you can adjust the step policy now. This works for any metric alarm and ECS services. If you're going to be trying to scale this...

AWS ECS Private And Public Services

Image
Answer : The combination of both AWS load balancer ( for public access) and Amazon ECS Service Discovery ( for internal communication) is the perfect choice for the web application. Built-in service discovery in ECS is another feature that makes it easy to develop a dynamic container environment without needing to manage as many resources outside of your application. ECS and Route 53 combine to provide highly available, fully managed, and secure service discovery Service discovery is a technique for getting traffic from one container to another using the containers direct IP address, instead of an intermediary like a load balancer. It is suitable for a variety of use cases: Private, internal service discovery Low latency communication between services Long lived bidirectional connections, such as gRPC. Yes, you can use AWS ECS service discovery having all services in a private subnet to enable communication between them. This makes it possible for an E...