[CLF-C02 Practice Questions Q6] Preparing for a Traffic Peak That Lasts a Few Hours (Amazon EC2 Auto Scaling and On-Demand Instances)

CLF-C02 Practice Questions Q6 Preparing for a Traffic Peak That Lasts a Few Hours (Amazon EC2 Auto Scaling and On-Demand Instances) Certification

“I tend to think that preparing enough instances for the peak is the safe choice, but then I worry about the cost the rest of the time.”
“When traffic suddenly increases, I mix up whether to choose Auto Scaling, Reserved Instances, CloudFront, or Shield.”

AWS Certified Cloud Practitioner (exam code CLF-C02, CLF below) often asks you to choose a combination that handles traffic that jumps for only a short time, in terms of both performance and cost. The question is characteristic in that you combine a mechanism that adds and removes instances with a way of paying, and similarly named services line up among the incorrect options.

This article is Question 6 of a series that explains CLF practice questions one at a time. The author wrote the questions to match the scope of the exam; they are not actual exam questions. Choose your answer first, then read the explanation.


Question

A company runs a concert ticket sales site on Amazon EC2. For a few hours after sales open, traffic is about 10 times the usual level, and at all other times it stays low. The company wants to maintain performance at the peak while keeping costs down the rest of the time. Which combinations are appropriate? (Choose two.)

  • A. Use Amazon EC2 Auto Scaling to automatically add and remove instances according to the load
  • B. Use the added instances at On-Demand pricing, paying only for what you use
  • C. Buy Reserved Instances on a three-year term for the number of instances needed at the peak
  • D. Enable AWS Shield Advanced to prevent the traffic spike itself
  • E. Cache all requests with Amazon CloudFront and make EC2 unnecessary

Once you have chosen two answers, open the section below.

Show the answer (click to open)

Answer: A and B

With Amazon EC2 Auto Scaling in A, you add instances only at the peak to maintain performance, and with On-Demand pricing in B, you pay for the added instances only while you use them. When the peak ends, you can scale in, so you are not charged for the instances you removed.


The answer is A and B

The correct answers are A and B.

  • A: use Amazon EC2 Auto Scaling to add and remove instances automatically
  • B: use the added instances at On-Demand pricing

You add instances only at the peak to maintain performance, and remove them when the peak ends. You are not charged for the instances you removed. Let’s look at the options one at a time.


Explanation of each option

A: Add and remove instances with EC2 Auto Scaling (correct)

Amazon EC2 Auto Scaling automatically adds and removes EC2 instances according to load. On the left, "Normal" has 1 EC2 instance. After a red arrow labeled "Scale out", the center, "A few peak hours (about 10x)", has 10 EC2 instances. After a green arrow labeled "Scale in", the right, "After the peak", has 1 EC2 instance. Below: keep performance at the peak and run fewer instances the rest of the time

Amazon EC2 Auto Scaling automatically adds and removes EC2 instances according to the load. As shown in the diagram, you normally run a small number of instances, and when traffic jumps to about 10 times at the start of sales, you add instances. When the peak ends, you remove them again. This maintains performance at the peak.

B: On-Demand means you pay only for what you use (correct)

On the left is a bar chart of one sale day, by hour. The bars are the number of instances run, which is what you pay for, and the line is traffic. From 0:00 until just before 10:00 the bars are low, then they rise for only a few hours around 10:00 when sales open (add only for peak hours), and then return to the low level (no charge after scaling in). At the upper right, "On-Demand pricing": pay only for what you use, no long-term commitment, and added instances are also paid only for use. At the lower right, "Combine with Auto Scaling": if you scale in after the peak, those costs stop too

On-Demand pricing means you pay only for what you use. No long-term commitment is required. The diagram shows the number of instances over one sale day. The cost of the added instances is incurred only for the few hours of the peak. If you scale in after the peak, those costs stop too. Combined with Auto Scaling, you can match costs to demand.

C: Reserved Instances suit a steady amount (incorrect)

On the left is a bar chart of one sale day, by hour. The blue bars are the instances used and are high for only a few hours around 10:00. If you reserve the peak number of instances on a three-year term, every hour up to the red dotted line is shaded light red, which is the part you pay for but do not use. Pay for unused capacity outside those hours. Pay every day for 3 years. At the upper right, "Reserved Instances": a discount in exchange for committing to one or three years, which suits steady, always-on usage. At the lower right, "Short, sudden peaks": scale with Auto Scaling and pay On-Demand rates only for what you use

Reserved Instances are a mechanism that gives you a discount in exchange for committing to one or three years of usage. They suit the part of your usage that is steady and always on.

If you commit to three years at the peak number of instances, then as shown in the diagram, you keep paying for the capacity you do not use outside those few hours.

D: Shield Advanced is for DDoS protection (incorrect)

At the upper left, a red frame for an attacker, who floods the service with traffic to try to take it down. Red arrows (DDoS attack) go toward AWS Shield Advanced in the center (blocks attacks). The green frame at the lower left is legitimate customers rushing in when sales open, and the green arrows (traffic spike) pass through Shield Advanced (lets through) and reach the ticket sales site (EC2) on the right. Below: purpose is protection from DDoS attacks; it does not block a surge of legitimate customers (and should not)

AWS Shield Advanced is a service that protects you from DDoS attacks. A DDoS attack is an attack that floods a service with traffic to try to take it down.

The traffic spike when sales open comes from legitimate customers who want to buy tickets. Shield Advanced does not block it, and should not.

E: Even with CloudFront, EC2 is still needed (incorrect)

From the users on the left, two arrows go to Amazon CloudFront in the center (delivery near customers) and to the ticket sales site (EC2) on the right. The upper green arrow is "Images, etc.": CloudFront serves them from cache, so they do not reach EC2 and the load on EC2 goes down. The lower red arrow is "Ticket purchase": because it is per-customer processing, it cannot be cached, so it passes through CloudFront and reaches EC2, which processes the purchase. Below: CloudFront reduces the load on EC2; EC2 is still needed

Amazon CloudFront is a service that delivers content such as images from locations near your customers. It reduces the load on EC2, the origin server, by the amount it can serve from cache.

However, per-customer processing such as buying a ticket cannot be cached. As shown in the diagram, that processing reaches EC2. EC2 does not become unnecessary.


Choosing from the keywords in the question

Let’s sort out the keywords in the question and what to choose. For “a short peak, low the rest of the time,” choose Auto Scaling and On-Demand; for “steady, always running, long term,” choose Reserved Instances or Savings Plans.

Keywords in the questionWhat to choose
A short peak, low the rest of the timeEC2 Auto Scaling + On-Demand
Steady, always running, long termReserved Instances, Savings Plans
Deliver images and other content from near customersAmazon CloudFront
Protection from DDoS attacksAWS Shield (Advanced)

Key points

  • For a short, sudden peak, use EC2 Auto Scaling + On-Demand
  • Reserved Instances suit the part that is steady and always running
  • CloudFront lowers the load, but per-customer processing still needs EC2
  • Shield is for DDoS protection. It does not block a surge of legitimate customers

How Auto Scaling works, and the differences between purchase options such as On-Demand and Reserved Instances, are explained in detail in the course articles.

  • Lecture 4, Part 3: ELB and Auto Scaling
  • Lecture 13, Part 4: On-Demand and Reserved Instances

You can read all 14 lectures of AWS Cloud Practitioner Exam Prep in order from its series page.


The CLF-C02 Practice Questions series (100 questions)

All 100 questions with a reading guide: CLF-C02 Practice Questions

In this group (Questions 1–6: Cloud benefits and high availability):

This series is the English edition of 【CLF-C02 試験対策問題】, originally written in Japanese.

コメント

Copied title and URL