SlideShare una empresa de Scribd logo
1 de 11
Descargar para leer sin conexión
Containers Auto Scaling on AWS
Contents
Containers Auto Scaling on AWS .................................................................................................. 1
Introduction to Auto Scaling....................................................................................................... 1
Distributed Load Testing Using AWS Fargate........................................................................... 1
Installation and Configuration .................................................................................................... 2
Run the Load testing using Docker container............................................................................. 2
Taurus uses JMeter in the background........................................................................................ 3
Load Testing with ApacheBench.............................................................................................. 10
Summary................................................................................................................................... 11
References................................................................................................................................. 11
Introduction to Auto Scaling
AWS Auto Scaling monitors your applications and automatically adjusts capacity to maintain
steady, predictable performance at the lowest possible cost. Auto Scaling is a broad topic and a
lot of documentation is available on Amazon. This article covers the essential concepts, different
types and methods of applying Auto Scaling on Amazon Web Services, and most of all
implementing containers Auto Scaling on AWS.
AWS Auto Scaling has been a historical feature of Amazon Web Services. Following two types
of Auto Scaling have been most common as of now.
 EC2 - Amazon EC2 Auto Scaling
 ECS - Service Auto Scaling
There are also broader types of Auto Scaling in AWS, like Amazon ECS cluster auto scaling
where a larger scope of a project’s infrastructure can be applied.
Distributed Load Testing Using AWS Fargate
There was a need to perform load testing on web services implemented for a project. The tests
were conducted for a Web service running on Amazon ECS with a solution that runs Distributed
Load Tests using AWS Fargate and Taurus, which in turn uses JMeter in the background. We
can use it to test our services under high stress scenarios and understand its behavior and
scalability.
Following are the links where this has been explained in detail.
https://aws.amazon.com/solutions/implementations/distributed-load-testing-on-aws
https://github.com/aws-samples/distributed-load-testing-using-aws-fargate
https://www.youtube.com/watch?v=Uv7I75pLmb4
Installation and Configuration
Steps to install and configure Taurus Load testing environment.
$ git clone https://github.com/aws-samples/distributed-load-testing-using-
aws-fargate
$ cd distributed-load-testing-using-aws-fargate/
$ docker build -t load-tests-using-fargate .
Edit the taurus.yml file to include the website URL.
$ vi examples/http/taurus.yml
Modify the last line as per your requirement.
execution:
- concurrency: 10
ramp-up: 5m
hold-for: 25m
scenario: aws-website-test
scenarios:
aws-website-test:
requests:
- http://test.example.com/
The DNS domain example.com has been taken in this article, as the implementation was carried
out on a real DNS domain name that has been replaced to maintain confidentiality.
Run the Load testing using Docker container
[root@linux-host]# docker run -it load-tests-using-fargate taurus.yml
07:59:58 INFO: Taurus CLI Tool v1.15.3
07:59:58 INFO: Starting with configs: ['taurus.yml']
07:59:58 INFO: Configuring...
07:59:58 INFO: Artifacts dir: /tmp/artifacts
07:59:58 INFO: Preparing...
07:59:59 WARNING: Failed to check for updates
08:00:02 INFO: Starting...
08:00:02 INFO: Waiting for results...
08:00:02 INFO: Waiting for finish...
08:00:22 INFO: Changed data analysis delay to 5s
08:00:42 INFO: Changed data analysis delay to 3s
08:05:07 INFO: Changed data analysis delay to 4s
08:30:06 WARNING: Please wait for graceful shutdown...
08:30:06 INFO: Shutting down...
08:30:06 INFO: Post-processing...
08:30:07 INFO: Test duration: 0:30:04
Taurus uses JMeter in the background
As the Taurus script is now in the running state, the load on web server started on the URL
http://test.example.com and as per the scaling policy, the tasks on ECS start to scale out to 4 as
shown in the next section.
Figure: Taurus running as Docker container
Figure: Service getting into Alarm State
Figure: Time window when web requests were high due to Load Testing
Figure: Alarm Details
Figure: Alarm Trigger Action
Figure: Cluster service with 4 scaled out AWS Fargate tasks
Figure: Tasks reach their maximum limit, showing Task IDs and other details
Figure: Taurus at 89% just before finishing the Load Testing
After the load testing script stopped, we now see that tasks are being decremented to 3, as shown
in the image below.
Figure: Events showing container tasks decrementing
Figure: Running Task count is now at 3 as per desired count
Figure: Desired task count is now 2
Figure: Running Task count is now at 2 as per desired count
Figure: Desired task count is now 1
Figure: Load at its minimum. Running Task count is now 1
Load Testing with ApacheBench
Another Load Testing tool called Apache Bench was brought into use, which has the syntax
given as follows.
[root@linux-host ~]# ab -n 100000 -c 1000 http://test.example.com/
This will execute 100000 HTTP GET requests, processing up to 1000 requests concurrently, to
the specified URL http://test.example.com/ and output the results on the command line as given
below. Multiple such commands were run in batch, one after the other for a continued load on
the given URL.
[root@linux-host ~]# ab -n 100000 -c 1000 http://test.example.com/
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking test.example.com (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests
Server Software: nginx/1.16.0
Server Hostname: test.example.com
Server Port: 80
Document Path: /
Document Length: 3032 bytes
Concurrency Level: 1000
Time taken for tests: 25.826 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Total transferred: 326600000 bytes
HTML transferred: 303200000 bytes
Requests per second: 3872.01 [#/sec] (mean)
Time per request: 258.264 [ms] (mean)
Time per request: 0.258 [ms] (mean, across all concurrent requests)
Transfer rate: 12349.60 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 97 123 146.2 101 2136
Processing: 98 126 111.5 102 2899
Waiting: 97 107 56.1 102 2797
Total: 195 248 190.5 204 4020
Percentage of the requests served within a certain time (ms)
50% 204
66% 206
75% 208
80% 209
90% 214
95% 615
98% 1208
99% 1309
100% 4020 (longest request)
Summary
In this article, we saw a web service that was implemented on Amazon ECS (Elastic Container
Service) that uses NGinx web server. To accommodate large number to simultaneous requests,
AWS Auto scaling was planned and implemented. Thereafter, to test the web service, load
testing was performed using Taurus that sent 1000’s of web requests simultaneously. This
triggered an alarm in AWS and our ECS containers started to scale up to become 4 similar tasks
running in parallel. When the load on web server was removed by stopping the scripts, the ECS
containers gradually cool down and decrement back to the original state.
References
https://docs.aws.amazon.com/AmazonECS/latest/userguide/service-autoscaling-
targettracking.html
https://medium.com/@kgekkula.at/aws-fargate-scaling-with-target-tracking-policy-
4c79149cb3dc
Document version 2
Dated: 30th April 2022

Más contenido relacionado

Similar a Containers Auto Scaling on AWS.pdf

Week1SP800-145 NIST Cloud Definitionhttpnvlpubs.nist.govni.docx
Week1SP800-145 NIST Cloud Definitionhttpnvlpubs.nist.govni.docxWeek1SP800-145 NIST Cloud Definitionhttpnvlpubs.nist.govni.docx
Week1SP800-145 NIST Cloud Definitionhttpnvlpubs.nist.govni.docx
philipnelson29183
 
Final Report To Executive ManagersXXXXXCCA 625Un
Final Report To Executive ManagersXXXXXCCA 625UnFinal Report To Executive ManagersXXXXXCCA 625Un
Final Report To Executive ManagersXXXXXCCA 625Un
ChereCheek752
 
Magento Hosting on AWS
Magento Hosting on AWS Magento Hosting on AWS
Magento Hosting on AWS
Gaurav "GP" Pal
 

Similar a Containers Auto Scaling on AWS.pdf (20)

AWS Webcast - What is Cloud Computing?
AWS Webcast - What is Cloud Computing?AWS Webcast - What is Cloud Computing?
AWS Webcast - What is Cloud Computing?
 
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Ka...
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Ka...Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Ka...
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Ka...
 
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Kafka
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & KafkaBack-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Kafka
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Kafka
 
App fabric introduction
App fabric introductionApp fabric introduction
App fabric introduction
 
Load testing with Blitz
Load testing with BlitzLoad testing with Blitz
Load testing with Blitz
 
Monitoring Weave Cloud with Prometheus
Monitoring Weave Cloud with PrometheusMonitoring Weave Cloud with Prometheus
Monitoring Weave Cloud with Prometheus
 
A 60-minute tour of AWS Compute (November 2016)
A 60-minute tour of AWS Compute (November 2016)A 60-minute tour of AWS Compute (November 2016)
A 60-minute tour of AWS Compute (November 2016)
 
Week1SP800-145 NIST Cloud Definitionhttpnvlpubs.nist.govni.docx
Week1SP800-145 NIST Cloud Definitionhttpnvlpubs.nist.govni.docxWeek1SP800-145 NIST Cloud Definitionhttpnvlpubs.nist.govni.docx
Week1SP800-145 NIST Cloud Definitionhttpnvlpubs.nist.govni.docx
 
StackWatch: A prototype CloudWatch service for CloudStack
StackWatch: A prototype CloudWatch service for CloudStackStackWatch: A prototype CloudWatch service for CloudStack
StackWatch: A prototype CloudWatch service for CloudStack
 
Reusable, composable, battle-tested Terraform modules
Reusable, composable, battle-tested Terraform modulesReusable, composable, battle-tested Terraform modules
Reusable, composable, battle-tested Terraform modules
 
Software as a Service workshop / Unlocked: the Hybrid Cloud 12th May 2014
Software as a Service workshop / Unlocked: the Hybrid Cloud 12th May 2014Software as a Service workshop / Unlocked: the Hybrid Cloud 12th May 2014
Software as a Service workshop / Unlocked: the Hybrid Cloud 12th May 2014
 
Final Report To Executive ManagersXXXXXCCA 625Un
Final Report To Executive ManagersXXXXXCCA 625UnFinal Report To Executive ManagersXXXXXCCA 625Un
Final Report To Executive ManagersXXXXXCCA 625Un
 
Advanced Container Management and Scheduling
Advanced Container Management and SchedulingAdvanced Container Management and Scheduling
Advanced Container Management and Scheduling
 
Scaling drupal horizontally and in cloud
Scaling drupal horizontally and in cloudScaling drupal horizontally and in cloud
Scaling drupal horizontally and in cloud
 
AWS Lambda from the trenches
AWS Lambda from the trenchesAWS Lambda from the trenches
AWS Lambda from the trenches
 
Magento Hosting on AWS
Magento Hosting on AWS Magento Hosting on AWS
Magento Hosting on AWS
 
Cloud cost optimization (AWS, GCP)
Cloud cost optimization (AWS, GCP)Cloud cost optimization (AWS, GCP)
Cloud cost optimization (AWS, GCP)
 
NGINX Can Do That? Test Drive Your Config File!
NGINX Can Do That? Test Drive Your Config File!NGINX Can Do That? Test Drive Your Config File!
NGINX Can Do That? Test Drive Your Config File!
 
Getting Started with Serverless and Container Architectures
Getting Started with Serverless and Container ArchitecturesGetting Started with Serverless and Container Architectures
Getting Started with Serverless and Container Architectures
 
Cloud Run - the rise of serverless and containerization
Cloud Run - the rise of serverless and containerizationCloud Run - the rise of serverless and containerization
Cloud Run - the rise of serverless and containerization
 

Más de Manish Chopra

Big-Data-Seminar-6-Aug-2014-Koenig
Big-Data-Seminar-6-Aug-2014-KoenigBig-Data-Seminar-6-Aug-2014-Koenig
Big-Data-Seminar-6-Aug-2014-Koenig
Manish Chopra
 

Más de Manish Chopra (20)

AWS and Slack Integration - Sending CloudWatch Notifications to Slack.pdf
AWS and Slack Integration - Sending CloudWatch Notifications to Slack.pdfAWS and Slack Integration - Sending CloudWatch Notifications to Slack.pdf
AWS and Slack Integration - Sending CloudWatch Notifications to Slack.pdf
 
Getting Started with ChatGPT.pdf
Getting Started with ChatGPT.pdfGetting Started with ChatGPT.pdf
Getting Started with ChatGPT.pdf
 
OpenKM Solution Document
OpenKM Solution DocumentOpenKM Solution Document
OpenKM Solution Document
 
Alfresco Content Services - Solution Document
Alfresco Content Services - Solution DocumentAlfresco Content Services - Solution Document
Alfresco Content Services - Solution Document
 
Jenkins Study Guide ToC
Jenkins Study Guide ToCJenkins Study Guide ToC
Jenkins Study Guide ToC
 
Ansible Study Guide ToC
Ansible Study Guide ToCAnsible Study Guide ToC
Ansible Study Guide ToC
 
Microservices with Dockers and Kubernetes
Microservices with Dockers and KubernetesMicroservices with Dockers and Kubernetes
Microservices with Dockers and Kubernetes
 
Unix and Linux Operating Systems
Unix and Linux Operating SystemsUnix and Linux Operating Systems
Unix and Linux Operating Systems
 
Working with Hive Analytics
Working with Hive AnalyticsWorking with Hive Analytics
Working with Hive Analytics
 
Preparing a Dataset for Processing
Preparing a Dataset for ProcessingPreparing a Dataset for Processing
Preparing a Dataset for Processing
 
Organizations with largest hadoop clusters
Organizations with largest hadoop clustersOrganizations with largest hadoop clusters
Organizations with largest hadoop clusters
 
Distributed File Systems
Distributed File SystemsDistributed File Systems
Distributed File Systems
 
Difference between hadoop 2 vs hadoop 3
Difference between hadoop 2 vs hadoop 3Difference between hadoop 2 vs hadoop 3
Difference between hadoop 2 vs hadoop 3
 
Oracle solaris 11 installation
Oracle solaris 11 installationOracle solaris 11 installation
Oracle solaris 11 installation
 
Big Data Analytics Course Guide TOC
Big Data Analytics Course Guide TOCBig Data Analytics Course Guide TOC
Big Data Analytics Course Guide TOC
 
Emergence and Importance of Cloud Computing for the Enterprise
Emergence and Importance of Cloud Computing for the EnterpriseEmergence and Importance of Cloud Computing for the Enterprise
Emergence and Importance of Cloud Computing for the Enterprise
 
Steps to create an RPM package in Linux
Steps to create an RPM package in LinuxSteps to create an RPM package in Linux
Steps to create an RPM package in Linux
 
Setting up a HADOOP 2.2 cluster on CentOS 6
Setting up a HADOOP 2.2 cluster on CentOS 6Setting up a HADOOP 2.2 cluster on CentOS 6
Setting up a HADOOP 2.2 cluster on CentOS 6
 
The Anatomy of GOOGLE Search Engine
The Anatomy of GOOGLE Search EngineThe Anatomy of GOOGLE Search Engine
The Anatomy of GOOGLE Search Engine
 
Big-Data-Seminar-6-Aug-2014-Koenig
Big-Data-Seminar-6-Aug-2014-KoenigBig-Data-Seminar-6-Aug-2014-Koenig
Big-Data-Seminar-6-Aug-2014-Koenig
 

Último

AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
Alluxio, Inc.
 
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
mbmh111980
 

Último (20)

Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024
 
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfImplementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
 
Crafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationCrafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM Integration
 
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
 
A Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data MigrationA Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data Migration
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
 
AI Hackathon.pptx
AI                        Hackathon.pptxAI                        Hackathon.pptx
AI Hackathon.pptx
 
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
 
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdf
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdfMicrosoft 365 Copilot; An AI tool changing the world of work _PDF.pdf
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdf
 
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
 
The Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion ProductionThe Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion Production
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning Framework
 
Workforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdfWorkforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdf
 
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfA Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
 
how-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfhow-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdf
 
CompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdfCompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdf
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
 
SQL Injection Introduction and Prevention
SQL Injection Introduction and PreventionSQL Injection Introduction and Prevention
SQL Injection Introduction and Prevention
 
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
 
Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024
 

Containers Auto Scaling on AWS.pdf

  • 1. Containers Auto Scaling on AWS Contents Containers Auto Scaling on AWS .................................................................................................. 1 Introduction to Auto Scaling....................................................................................................... 1 Distributed Load Testing Using AWS Fargate........................................................................... 1 Installation and Configuration .................................................................................................... 2 Run the Load testing using Docker container............................................................................. 2 Taurus uses JMeter in the background........................................................................................ 3 Load Testing with ApacheBench.............................................................................................. 10 Summary................................................................................................................................... 11 References................................................................................................................................. 11 Introduction to Auto Scaling AWS Auto Scaling monitors your applications and automatically adjusts capacity to maintain steady, predictable performance at the lowest possible cost. Auto Scaling is a broad topic and a lot of documentation is available on Amazon. This article covers the essential concepts, different types and methods of applying Auto Scaling on Amazon Web Services, and most of all implementing containers Auto Scaling on AWS. AWS Auto Scaling has been a historical feature of Amazon Web Services. Following two types of Auto Scaling have been most common as of now.  EC2 - Amazon EC2 Auto Scaling  ECS - Service Auto Scaling There are also broader types of Auto Scaling in AWS, like Amazon ECS cluster auto scaling where a larger scope of a project’s infrastructure can be applied. Distributed Load Testing Using AWS Fargate There was a need to perform load testing on web services implemented for a project. The tests were conducted for a Web service running on Amazon ECS with a solution that runs Distributed Load Tests using AWS Fargate and Taurus, which in turn uses JMeter in the background. We can use it to test our services under high stress scenarios and understand its behavior and scalability.
  • 2. Following are the links where this has been explained in detail. https://aws.amazon.com/solutions/implementations/distributed-load-testing-on-aws https://github.com/aws-samples/distributed-load-testing-using-aws-fargate https://www.youtube.com/watch?v=Uv7I75pLmb4 Installation and Configuration Steps to install and configure Taurus Load testing environment. $ git clone https://github.com/aws-samples/distributed-load-testing-using- aws-fargate $ cd distributed-load-testing-using-aws-fargate/ $ docker build -t load-tests-using-fargate . Edit the taurus.yml file to include the website URL. $ vi examples/http/taurus.yml Modify the last line as per your requirement. execution: - concurrency: 10 ramp-up: 5m hold-for: 25m scenario: aws-website-test scenarios: aws-website-test: requests: - http://test.example.com/ The DNS domain example.com has been taken in this article, as the implementation was carried out on a real DNS domain name that has been replaced to maintain confidentiality. Run the Load testing using Docker container [root@linux-host]# docker run -it load-tests-using-fargate taurus.yml 07:59:58 INFO: Taurus CLI Tool v1.15.3 07:59:58 INFO: Starting with configs: ['taurus.yml'] 07:59:58 INFO: Configuring... 07:59:58 INFO: Artifacts dir: /tmp/artifacts 07:59:58 INFO: Preparing... 07:59:59 WARNING: Failed to check for updates 08:00:02 INFO: Starting... 08:00:02 INFO: Waiting for results... 08:00:02 INFO: Waiting for finish... 08:00:22 INFO: Changed data analysis delay to 5s 08:00:42 INFO: Changed data analysis delay to 3s 08:05:07 INFO: Changed data analysis delay to 4s 08:30:06 WARNING: Please wait for graceful shutdown... 08:30:06 INFO: Shutting down... 08:30:06 INFO: Post-processing... 08:30:07 INFO: Test duration: 0:30:04
  • 3. Taurus uses JMeter in the background As the Taurus script is now in the running state, the load on web server started on the URL http://test.example.com and as per the scaling policy, the tasks on ECS start to scale out to 4 as shown in the next section. Figure: Taurus running as Docker container Figure: Service getting into Alarm State
  • 4. Figure: Time window when web requests were high due to Load Testing Figure: Alarm Details
  • 5. Figure: Alarm Trigger Action Figure: Cluster service with 4 scaled out AWS Fargate tasks
  • 6. Figure: Tasks reach their maximum limit, showing Task IDs and other details Figure: Taurus at 89% just before finishing the Load Testing
  • 7. After the load testing script stopped, we now see that tasks are being decremented to 3, as shown in the image below. Figure: Events showing container tasks decrementing Figure: Running Task count is now at 3 as per desired count
  • 8. Figure: Desired task count is now 2 Figure: Running Task count is now at 2 as per desired count
  • 9. Figure: Desired task count is now 1 Figure: Load at its minimum. Running Task count is now 1
  • 10. Load Testing with ApacheBench Another Load Testing tool called Apache Bench was brought into use, which has the syntax given as follows. [root@linux-host ~]# ab -n 100000 -c 1000 http://test.example.com/ This will execute 100000 HTTP GET requests, processing up to 1000 requests concurrently, to the specified URL http://test.example.com/ and output the results on the command line as given below. Multiple such commands were run in batch, one after the other for a continued load on the given URL. [root@linux-host ~]# ab -n 100000 -c 1000 http://test.example.com/ This is ApacheBench, Version 2.3 <$Revision: 1430300 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking test.example.com (be patient) Completed 10000 requests Completed 20000 requests Completed 30000 requests Completed 40000 requests Completed 50000 requests Completed 60000 requests Completed 70000 requests Completed 80000 requests Completed 90000 requests Completed 100000 requests Finished 100000 requests Server Software: nginx/1.16.0 Server Hostname: test.example.com Server Port: 80 Document Path: / Document Length: 3032 bytes Concurrency Level: 1000 Time taken for tests: 25.826 seconds Complete requests: 100000 Failed requests: 0 Write errors: 0 Total transferred: 326600000 bytes HTML transferred: 303200000 bytes Requests per second: 3872.01 [#/sec] (mean) Time per request: 258.264 [ms] (mean) Time per request: 0.258 [ms] (mean, across all concurrent requests) Transfer rate: 12349.60 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 97 123 146.2 101 2136 Processing: 98 126 111.5 102 2899 Waiting: 97 107 56.1 102 2797 Total: 195 248 190.5 204 4020
  • 11. Percentage of the requests served within a certain time (ms) 50% 204 66% 206 75% 208 80% 209 90% 214 95% 615 98% 1208 99% 1309 100% 4020 (longest request) Summary In this article, we saw a web service that was implemented on Amazon ECS (Elastic Container Service) that uses NGinx web server. To accommodate large number to simultaneous requests, AWS Auto scaling was planned and implemented. Thereafter, to test the web service, load testing was performed using Taurus that sent 1000’s of web requests simultaneously. This triggered an alarm in AWS and our ECS containers started to scale up to become 4 similar tasks running in parallel. When the load on web server was removed by stopping the scripts, the ECS containers gradually cool down and decrement back to the original state. References https://docs.aws.amazon.com/AmazonECS/latest/userguide/service-autoscaling- targettracking.html https://medium.com/@kgekkula.at/aws-fargate-scaling-with-target-tracking-policy- 4c79149cb3dc Document version 2 Dated: 30th April 2022