Abekus — AI learning and job matching platform logo

Paying only for what you use

Lesson 3 of 88 in AWS Certified Cloud Practitioner (CLF-C02) Exam Prep. Free to read, with practice questions to try.

Paying for what you use

Pay-as-you-go pricing means you pay for cloud resources only while you use them, with no large upfront purchase. ChaiCart's website runs on AWS in the Mumbai Region (ap-south-1), and it rents its servers instead of buying them outright and pays for each second they run (60-second minimum on Linux). The examples in this lesson use simple hourly rates. This suits a tea shop whose traffic rises and falls. In quiet hours the bill stays small, and nothing is locked in before the first order arrives.

Metered usage billing

Metered usage billing means AWS measures how much of each resource you consume and charges for those measurements. Each meter has its own unit, such as hours a server runs or gigabytes of data stored. Here is one month for ChaiCart, using illustrative rates (these are not real AWS prices):

MeterUsageRateCharge
Web servers (EC2) running hours300 hours₹10 per hour₹3,000
Product images in S320 GB stored₹2 per GB₹40
Database (RDS MySQL) running hours200 hours₹15 per hour₹3,000

The total bill is each meter's usage multiplied by its rate, then added together: ₹6,040.

Idle versus used capacity

A running server is billed for every second it is on (60-second minimum on Linux), whether it is serving customers or doing nothing. Idle capacity is capacity that is running but not doing useful work, and it is billed in full. Used capacity is the part that is actually serving work. Say ChaiCart's web server is quiet from 10 pm to 8 am, which is 10 hours. Left running, it costs 10 x ₹10 = ₹100 each night, so 30 nights of idle running add up to ₹3,000.

Stopping the server at 10 pm and starting it at 8 am removes the instance charge for those 10 hours; attached EBS storage still bills while the server is stopped.

Upfront servers versus pay-as-you-go

Buying servers upfront means paying for enough capacity to handle the busiest moment, such as festival season, and then owning that hardware through the quiet months. Pay-as-you-go lets ChaiCart rent extra servers only for the days they are needed. Illustrative numbers: four owned servers at ₹1,00,000 each cost ₹4,00,000 before the first festival. Pay-as-you-go needs three extra servers for 10 festival days, which is 3 x 240 hours x ₹10 = ₹7,200 extra.

ItemOwned serversPay-as-you-go on AWS
When the money leaves₹4,00,000 upfrontOnly as hours are used
Festival capacityFour servers bought outrightThree servers rented for 10 days
Cost of festival extrasAlready paid in the ₹4,00,000₹7,200
Between peaksExtra servers sit idle, still ownedExtra servers are stopped

These figures ignore the other running costs of owned hardware.

The forgotten test server

A developer at ChaiCart starts a test server on Friday at 6 pm and forgets it. Nobody uses it over the weekend, and it is still running when the team returns on Monday at 9 am. Before reading on, predict: how many hours is that server billed for doing no work, and what does it cost at ₹10 per hour?

The server runs from Friday 6 pm to Monday 9 am, which is 63 hours. At ₹10 per hour, that is ₹630 for a server that served nobody.

The fix is to stop it on Friday evening, which ends the instance charge for the weekend. Attached EBS storage still bills while it is stopped, so a server nobody needs should be terminated. Termination stops the instance charge and deletes attached volumes set to delete on termination; other attached volumes persist and still bill.

Practice questions

  1. 1.

    ChaiCart buys four servers for ₹4,00,000 to cover a 10-day festival. The festival lasts only 4 days instead. How does the owned-server cost change?

    • A.

      Owned cost drops to zero once the festival ends.

    • B.

      Owned cost rises, since the same servers serve fewer days.

    • C.

      Owned cost falls to ₹1,60,000, pro rata to four days.

    • D.

      Owned cost stays ₹4,00,000, because the hardware was paid for at purchase.

    Show answer
    Answer: D.

    Owned cost stays ₹4,00,000, because the hardware was paid for at purchase.

    The ₹4,00,000 was paid when the servers were bought, so a shorter festival does not reduce it. Option 3 wrongly assumes the cost is prorated by days of use. Option 1 wrongly assumes the cost ends when demand ends; the owned hardware is still paid for. Option 2 wrongly treats a shorter festival as raising the cost, when the fixed amount is simply spread over fewer days of use.

  2. 2.

    A ChaiCart test server is stopped on Friday evening, not terminated, and it has an attached EBS volume. What is billed over the weekend?

    • A.

      Nothing, because a stopped server is not billed

    • B.

      The attached EBS storage, which keeps billing while the server is stopped

    • C.

      The full hourly instance rate, as if the server were running

    • D.

      Nothing, because stopping an instance deletes its attached EBS volumes

    Show answer
    Answer: B.

    The attached EBS storage, which keeps billing while the server is stopped

    Stopping ends the hourly instance charge, but attached EBS storage keeps billing until the volume is deleted. Option 1 treats a stopped server as free, which ignores the storage. Option 3 charges the running rate, which a stopped server does not incur. Option 4 is wrong because stopping does not delete attached volumes.

  3. 3.

    Which ChaiCart server arrangement needs no large upfront purchase?

    • A.

      Four servers bought outright to cover festival season

    • B.

      Web servers rented by the hour, billed only while running

    • C.

      Four owned servers paid for before the first festival

    • D.

      Web servers owned outright and kept through quiet months

    Show answer
    Answer: B.

    Web servers rented by the hour, billed only while running

    Renting web servers by the hour is pay-as-you-go: charges accrue only while they run, with no large purchase before use. Buying four servers outright for festival season, paying for owned servers before the first festival, and keeping owned web servers through quiet months all require a large upfront purchase of hardware.

9 more questions and the timed quiz for this lesson open with a free account.

Lessons in A Shop Moves To The Cloud

  1. One shop website moved from an office server to aws
  2. Renting capacity vs buying servers
  3. Paying only for what you use
  4. Managed vs self-managed services
  5. Cloud vs hybrid vs on-premises deployment

88 lessons across 10 topics. See the full course