Chaos Engineering

Chaos Engineering on Serverless Fargate

Demo Run experiment Task IO stress

In this walkthrough, we’ll create an AWS Fault Injection Simulator (FIS) experiment template to inject I/O stress on an ECS Fargate task. ECS Fargate offers a serverless compute engine for container workloads on Amazon ECS or EKS, eliminating the need to manage EC2 instances. By the end of this tutorial, you’ll know how to configure an FIS template to target Fargate tasks, apply I/O load, and monitor the impact in real time.

Prerequisites

  • An existing ECS Fargate service with tasks prefixed by pay-for-adoption
  • IAM role for FIS (e.g., AWSFISRole) with fis.amazonaws.com trust and necessary permissions
  • CloudWatch log group (e.g., FIS-experiments) for experiment logs

Table of Contents


Step 1: Create a New Experiment Template

  1. Sign in to the AWS Console and go to AWS Fault Injection Simulator (FIS) > Experiment templates.
  2. Click Create experiment template, then confirm your AWS account.
  3. Fill in the basic details:
    • Name: ecs-fargate-io-stress-test (optional)
    • Description:
      ECS Fargate I/O stress test  
      
  4. Leave other settings at their defaults and proceed to the Actions section.

Step 2: Define the I/O Stress Action

  1. Under Actions, click Add action.
  2. For Action name, enter:
    ecs-fargate-io-stress-test
    
  3. Select AWS ECS Task I/O stress as the Action type.
  4. Configure action parameters:
ParameterValueDescription
Duration10 minutesTotal time to run the I/O stress
Workers(default)Number of parallel I/O workers
Task count(default)Percentage or number of tasks to affect
  1. Click Save.

The image shows a form for creating an experiment template in AWS, specifically for an ECS Fargate IO stress test. It includes fields for action type, target, duration, and optional parameters like dependencies and workers.

Step 3: Configure the Target

  1. Scroll to Targets and choose Add target.
  2. Set Resource type to ecs:Task.
  3. Under Target method, pick Resource ID.
  4. In the filter box, enter the prefix pay-for-adoption to find matching tasks.
  5. Select both ECS Fargate tasks from the results.
  6. Keep Selection mode as All (to target every matching task).
  7. Click Save.

The image shows a user interface for creating an experiment template in AWS, specifically editing a target for an ECS Fargate IO stress test. It includes fields for naming, resource type, and selecting actions.

Step 4: Assign IAM Role and Enable Logging

  1. Under Experiment role, choose your IAM role for FIS (e.g., AWSFISRole).
  2. In Logs, select Send logs to CloudWatch Logs and choose the log group FIS-experiments.
  3. Click Create experiment template to finalize.

Warning

Ensure your IAM role has permissions for both FIS actions and CloudWatch logging. Missing permissions can cause experiment failures.

Step 5: Review and Launch

  1. On the template summary page, verify:
    • The action name and parameters
    • The target tasks
    • The experiment role and log configuration
  2. Click Start experiment.
  3. Monitor the state switch to Running.

The image shows an AWS Resilience Hub interface, specifically the Fault Injection Service (FIS) section, displaying details of an experiment template with targets and a preview of resources.

After starting, switch to the AWS FIS dashboard to track progress and view metrics like CPU usage, memory, and I/O throughput in real time.

The image shows an AWS Fault Injection Simulator (FIS) dashboard with details of a running experiment, including its ID, state, creation time, and associated resources. The interface displays options for managing the experiment, such as stopping it and viewing logs.

Use these insights to analyze how I/O stress impacts your application’s performance and resilience.

References

Watch Video

Watch video content

Previous
Demo Fargate IAM role creation