PERFORMANCE CHECKLIST FOR ECS PRODUCTION INFRASTRUCTURE

S.NO AWS SERVICE ACTION DESCRIPTION METHOD TO SOLVE SUGGESTIONS

1

ECR

Image optimization

Optimize Dockerfile to minimize the number of layers in the images. Use multi-stage builds to reduce the size of the final image.

2

ECS

Cluster size optimization

Ensure your ECS cluster is appropriately sized based on the resource requirements of the containers.

Auto Scaling

Enable Auto Scaling on ECS cluster to automatically adjust the number of running tasks based on demand ,by Setting up scaling policies based on metrics such as CPU and memory utilization.

Capacity providers

ECS Capacity Providers can be associated with specific Autoscaling groups. This association allows ECS to manage the capacity of the cluster using the instances launched by the Autoscaling group.

Optimal Task Placement stratergy

Task placement ensures that containers are distributed efficiently across instances, by the associated autoscaling and capacity providers.

3

LOAD BALANCER

Deletion Protection Flag Enabled

Deletion Protection flag should be enabled in order to prevent accidental deletions.

Ensure ELBs are evenly distributed over AZs

Ensure that the EC2 instances registered to Amazon Elastic Load Balancing (ELB) are evenly distributed across all Availability Zones (AZs) in order to improve the ELBs configuration reliability

Use the right health check configurations

Improve the reliability of the applications behind your app-tier ELBs by using the appropriate health check configuration.

Connection Draining enabled

Elastic Load Balancer will not send any new requests to the unhealthy instance if an EC2 backend instance fails health checks

4

S3

Use Byte-Range Fetches

If objects are PUT using a multipart upload, it’s a good practice to GET them in the same part sizes (or at least aligned to part boundaries) for best performance.

Versioning

Enable versioning for critical data to maintain a version history and recover from accidental deletions or modifications.

Use Transfer Acceleration

Enable Amazon S3 Transfer Acceleration to speed up uploads to and downloads from S3 bucket.

Lifecycle Policies

Use lifecycle policies to automatically transition objects to lower-cost storage classes or delete them when they are no longer needed.

5

API GATEWAY

Cache Configuration

Enable caching at the API Gateway level to reduce the load on backend systems.Configure cache settings such as cache capacity, TTL (time-to-live) etc

Request and Response Payloads

Minimize the size of request and response payloads to reduce latency. Use compression for larger payloads to improve data transfer efficiency.

Connection Pooling

If using backend services, enable connection pooling to reuse connections and reduce connection setup overhead

Throttling and Rate Limiting

Implement throttling and rate limiting to prevent abuse and ensure fair usage.Set appropriate limits based on your API’s expected traffic.

6

EC2

Right Instance Type

Choose an EC2 instance type that aligns with your application’s resource requirements (CPU, memory, storage, network).Consider burstable performance instances (T3, T4g) for workloads with variable performance needs.

Elastic Block Store (EBS) Optimization

Choose the appropriate EBS volume type (SSD, HDD) and size for storage needs. Consider using Provisioned IOPS for applications with high I/O requirements.

7

RDS

Right Database Engine and Version

Choose the appropriate database engine (e.g., MySQL, PostgreSQL, Oracle, SQL Server) based on application requirements & Keep the database engine version up to date

Instance Class type

Select the right RDS instance type based on database workload, considering CPU, memory, and I/O requirements.Use the AWS RDS Performance Insights feature to analyze and visualize database performance.

Multi-AZ Deployment

Consider using Multi-AZ (Availability Zone) deployments for high availability and automatic failover in case of a hardware failure. Be aware that Multi-AZ deployments can impact read performance due to synchronous replication.

Read Replicas

Use Read Replicas for read scalability and to offload read traffic from the primary database. Implement read/write splitting in your application to distribute read and write requests.

Backup Configuration

Configure automated backups and set a retention period that meets your data recovery requirements. Use Amazon RDS snapshots for manual backups and database cloning.

Database Indexing

Create and maintain appropriate indexes to improve query performance. Regularly analyze query execution plans to identify areas for optimization.

8

ROUTE 53

Distributed DNS Resolvers

Configure your DNS resolvers to be geographically distributed to minimize latency for end-users.

Traffic Routing Policies

Choose the appropriate traffic routing policy for your use case (e.g., simple routing, weighted routing, latency-based routing, geolocation-based routing). Use weighted routing for load balancing across multiple resources.

Health Checks

Implement health checks for routing policies that support them (e.g., latency-based, weighted). Use health checks to monitor the availability of resources and reroute traffic in case of failures.

TTL Settings

Adjust Time-to-Live (TTL) settings appropriately based on your use case. Consider a lower TTL during migrations or changes to facilitate faster DNS record propagation.

9

CLOUDWATCH

Resource-Level Metrics

Enable resource-level metrics for AWS services to gather detailed insights into the performance of individual resources. For EC2 instances, consider enabling detailed monitoring for more granular metrics.

Alarms

Set up CloudWatch Alarms to receive notifications when a specified metric crosses a predefined threshold.

Log data backup & disaster recovery cloudwatch

Set up log data export to Amazon S3 for long-term storage and backup. CloudWatch Logs allows you to create export tasks that periodically deliver log data to an S3 bucket.