You are having a web and worker role infrastructure defined in AWS using Amazon EC2 resources.
You are using SQS to manage the jobs being sent by the web role.
Which of the following is the right way to ensure the worker processes are adequately set up to handle the number of jobs sent by the web role?
Click on the arrows to vote for the correct answer
A. B. C. D.Answer - D.
The below diagram shows how SQS can be used to manage the communication between the Web and worker roles.
The number of messages in the SQS queue can be used to determine the number of instances that should be there in the AutoScaling Group.
For more information on SQS and Autoscaling, please refer to the below URL:
http://docs.aws.amazon.com/autoscaling/latest/userguide/as-using-sqs-queue.htmlThe correct answer is D. Use Cloudwatch monitoring to check the size of the queue and then scale out using Autoscaling to ensure that it can handle the right number of jobs.
Explanation:
Amazon EC2 provides the ability to automatically scale the number of instances in a fleet based on certain criteria. This feature is called Autoscaling. It's used to ensure that your application always has the right amount of compute capacity to handle the current load.
In this scenario, we are using SQS to manage the jobs being sent by the web role. SQS is a distributed message queue service that enables decoupling and scaling of microservices, distributed systems, and serverless applications.
The worker processes need to be adequately set up to handle the number of jobs sent by the web role. We can achieve this by monitoring the size of the queue using Amazon CloudWatch. CloudWatch is a monitoring service for AWS resources and the applications you run on them.
We can set up a CloudWatch alarm to trigger when the number of messages in the queue reaches a certain threshold. This alarm can then trigger an Autoscaling action to add more worker instances to handle the load.
Using ELB (Elastic Load Balancer) or Route53 (DNS management service) is not the right way to ensure that the worker processes are adequately set up to handle the number of jobs sent by the web role. While these services can help distribute traffic to the instances, they do not address the problem of ensuring that the instances can handle the load.
Therefore, the correct answer is D. Use Cloudwatch monitoring to check the size of the queue and then scale out using Autoscaling to ensure that it can handle the right number of jobs.