liveBook · Manning

Pay-per-use pricing

As explained in Amazon Web Services in Action, Third Edition: An in-depth guide to AWS

A pay-per-request pricing model charges for individual database requests rather than for continuously provisioned capacity or instance time.

Pay-per-use means AWS charges for services according to how you use them, rather than requiring an upfront infrastructure purchase. The unit of usage depends on the service: it may be time, requests, traffic, or stored data. Pay-per-request is a more specific model; it does not describe every AWS charge. section 1.10 section 1.4.2 section 12.0

What this means in practice:

  • For a batch job, launch a virtual machine when work starts and terminate it when work finishes instead of paying a monthly fee for a machine regardless of use. section 1.2.4
  • For a small application with a simple data structure, DynamoDB’s pay-per-request pricing can be a reason to choose it. The application must be built for DynamoDB; an existing MySQL application cannot simply be pointed at it. section 12.0
  • For a temporary evaluation, delete the CloudFormation stack when finished so its infrastructure stops running and incurring charges. section 2.4

When a web shop grows

A web shop’s visits rise from 100,000 to 500,000 in a month. Its AWS bill rises from about $112 to $473: CDN traffic and requests, web servers, and the database cost more, while the charge for unchanged static-file storage stays the same. Pay-per-use can therefore make costs grow with traffic, but not every line item changes in the same way. section 1.4.2

Table 1.1 How an AWS bill changes if the number of web shop visitors increases (view table figure)

Service

January usage

February usage

February charge

Increase

Visits to website

100,000

500,000

 

 

CDN

25 M requests + 25 GB traffic

125 M requests + 125 GB traffic

$115.00

$100.00

Static files

50 GB used storage

50 GB used storage

$1.15

$0.00

Load balancer

748 hours + 50 GB traffic

748 hours + 250 GB traffic

$19.07

$1.83

Web servers

1 virtual machine = 748 hours

4 virtual machines = 2,992 hours

$200.46

$150.35

Database (748 hours)

Small virtual machine + 20 GB storage

Large virtual machine + 20 GB storage

$133.20

$105.47

DNS

2 M requests

10 M requests

$4.00

$3.20

Total cost

 

 

$472.88

$360.85

Compare the bill’s usage units and charges: requests and traffic increase, storage stays constant, and the database is listed with instance hours and storage rather than as pay-per-request. section 1.4.2

Usage-based bills are not completely predictable. To watch costs, enable Free Tier usage alerts in AWS billing preferences. In Budgets, create a recurring monthly Cost Budget—for example, $5—and add email alerts at 100% for both actual and forecasted spending. An alert helps you react; deleting resources you no longer need stops their ongoing use. section 1.9 section 2.4

How Amazon Web Services in Action, Third Edition: An in-depth guide to AWS covers it

How deep it goes
Illustrates usage units and changing bills, then gives budget-alert steps; does not specify DynamoDB request rates or configuration.
Examples
Uses a batch job that terminates its virtual machine, a growing web shop bill, and DynamoDB-based batch-job tracking.
What it assumes
Assumes access to an AWS account for billing controls and explains pay-per-use through concrete service charges.
What you can do after
Operate/configure it by creating AWS Budgets alerts and deleting a finished CloudFormation stack to control ongoing costs.
How it connects
Connects pay-per-use to virtual machines, batch processing, DynamoDB, CloudFormation, and AWS Budgets.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Amazon Web Services in Action, Third Edition: An in-depth guide to AWS. The section links point to the parts of the book it draws on.