Cloud Resource Monitoring and Cost Optimization

Chapter 5
Availability, Performance, and Capacity Management

Diploma in Cloud Computing
Cloud Resource Monitoring and Cost Optimization   •   Diploma

Availability, Performance, and Capacity Management

Introduction

Cloud services are valuable only when they remain available, responsive, and capable of handling demand at an acceptable cost. Monitoring therefore extends beyond observing whether a virtual machine is running. A professional cloud practitioner must determine whether users can reach a service, how quickly it responds, how much work it completes, whether resources are approaching saturation, and whether failures in dependent components are limiting the whole system.

Availability, performance, and capacity management are closely related but distinct disciplines. Availability management seeks to keep services accessible and recoverable. Performance management seeks to maintain acceptable response times and processing efficiency. Capacity management ensures that sufficient resources exist now and can be provisioned for future demand without unnecessary expenditure. Together, these practices support reliability, user experience, operational continuity, and cost optimization.

This chapter develops a practical framework for analysing utilization, latency, throughput, saturation, errors, dependencies, and bottlenecks. It also explains load testing, capacity planning, scaling, and right-sizing in cloud environments.

Learning Objectives

By the end of this chapter, you should be able to:

  1. Distinguish availability, performance, reliability, and capacity.
  2. Interpret utilization, latency, throughput, saturation, and error metrics.
  3. Analyse dependencies and identify bottlenecks using evidence.
  4. Calculate basic availability, utilization, capacity, and response-time measures.
  5. Design a practical load-testing and capacity-planning approach.
  6. Select suitable scaling and right-sizing strategies.
  7. Evaluate the operational, financial, governance, and ethical implications of monitoring and optimization.

1. The Relationship Between Availability, Performance, and Capacity

A service may be technically available but practically unusable. For example, an online examination portal that returns a page after 45 seconds is reachable, but its performance may fail the service-level objective (SLO). Conversely, a service may be fast under normal demand but become unavailable when a database reaches its connection limit. Capacity decisions must therefore consider both quantity of resources and the way those resources interact.

1.1 Availability

Availability is the proportion of a defined period during which a service performs its intended function. A simple operational measure is:

Availability = (Agreed service time − Unavailable time) ÷ Agreed service time × 100%

Here, agreed service time and unavailable time must use the same unit, such as minutes per month. The formula assumes that downtime has been defined consistently and that exclusions, such as approved maintenance, are documented.

For a 30-day month with 43,200 minutes, 99.9% availability permits approximately:

43,200 × (1 − 0.999) = 43.2 minutes

Availability is not the same as reliability. Availability includes recovery after failure, whereas reliability commonly refers to operating without failure for a specified period. A service with frequent failures but rapid recovery may have high availability and poor reliability.

1.2 Performance

Performance describes how efficiently a service responds and processes work. Important dimensions include:

  • Latency: time taken to complete an operation.
  • Response time: often the user-observed time from request to response; it may include network, application, and dependency delays.
  • Throughput: completed work per unit of time, such as requests per second or transactions per minute.
  • Utilization: proportion of a resource’s available capacity being used.
  • Saturation: the degree to which a resource has no remaining ability to absorb additional work.
  • Error rate: proportion of operations that fail or produce an invalid result.

Average latency alone is insufficient. A system with a 100 ms average may still provide a poor experience if one user in twenty receives a response after 5 seconds. Percentiles are therefore important. The p95 latency is the value at or below which 95% of observations fall; p99 describes the slower tail experienced by 1% of observations.

1.3 Capacity

Capacity is the maximum sustainable workload a system can support while meeting specified performance and quality requirements. Capacity is not simply the number of CPU cores or gigabytes of memory. It depends on workload characteristics, architecture, configuration, dependencies, concurrency, and SLOs.

A capacity statement should be specific. “The service supports 500 users” is ambiguous. “The service supports 500 concurrent users generating 40 requests per second, with p95 latency below 400 ms and an error rate below 0.1%” is testable.

2. The Golden Signals and Supporting Metrics

A useful starting framework is the four golden signals:

SignalMeaningTypical examples
LatencyTime required to serve workp50, p95, p99 response time
TrafficDemand placed on the systemrequests/s, messages/s, active sessions
ErrorsFailed or incorrect operationsHTTP 5xx, timeouts, rejected jobs
SaturationRemaining or exhausted capacityCPU throttling, queue depth, connection limits

These signals should be interpreted together. High latency with low traffic may indicate a dependency failure. High traffic with stable latency may indicate healthy scaling. A rising queue and increasing latency usually indicate that arrivals are exceeding service capacity.

2.1 Utilization

For a resource with observed busy time and measurement interval:

Utilization = Busy time ÷ Available time × 100%

For CPU, this may approximate the proportion of CPU time spent doing work, although operating-system and cloud-provider definitions differ. For storage, utilization may refer to consumed space, I/O bandwidth, or I/O operations per second. These are different measures and must not be confused.

A 70% CPU reading does not automatically mean that 30% capacity is available for every workload. CPU may be only one constraint; memory, network bandwidth, database connections, or locks may saturate first.

2.2 Throughput and Little’s Law

Throughput is often measured as completed requests per second. In a stable system, Little’s Law relates the average number of items in a system to throughput and average time in the system:

L = λW

where:

  • L is the average number of items in the system;
  • λ is the average arrival or throughput rate, in items per unit time;
  • W is the average time an item spends in the system, in the same time unit.

The relationship assumes a stable system over the observation period and consistent definitions of the system boundary. For example, if a queue contains an average of 120 jobs and throughput is 30 jobs per second, the average time in the queue-and-processing system is:

W = L ÷ λ = 120 ÷ 30 = 4 seconds

Little’s Law does not by itself predict performance or prove causation. It is a diagnostic relationship: if throughput remains constant while the number of in-flight requests grows, average time must increase.

2.3 Errors and Availability Indicators

Errors should be classified rather than counted indiscriminately. Useful categories include client errors, server errors, timeouts, dependency failures, validation failures, throttling, and cancellations. A basic error rate is:

Error rate = Failed operations ÷ Total operations × 100%

The numerator and denominator must refer to the same operation type and interval. A low error rate can still represent substantial harm when transaction volume is high or when failures affect critical users.

3. Dependency and Bottleneck Analysis

Cloud applications are usually distributed systems. A user request may pass through a DNS service, content delivery network, load balancer, application tier, cache, database, message broker, and external API. The user-facing service is only as healthy as its critical dependencies.

A dependency map should identify:

  • direct and indirect dependencies;
  • synchronous and asynchronous calls;
  • network boundaries and regions;
  • data stores and connection pools;
  • authentication and authorization services;
  • third-party services;
  • retry, timeout, and circuit-breaker behaviour;
  • failure propagation paths.

3.1 Locating a Bottleneck

A bottleneck is a component whose limited capacity constrains the throughput or performance of the overall system. Evidence of a bottleneck may include:

  • resource utilization near a hard limit;
  • a growing queue or connection wait time;
  • rising latency as demand increases;
  • throttling or rejected requests;
  • high lock or contention time;
  • a dependency whose latency explains the end-to-end delay;
  • improvement in system performance when that component is scaled.

Correlation is not proof. High CPU and high latency may occur together because both are consequences of excessive traffic. Distributed tracing, controlled experiments, profiling, and comparison with baselines improve diagnosis.

3.2 Queues, Backpressure, and Cascading Failure

Queues absorb short-term variation but do not eliminate capacity shortages. If arrivals exceed service completions for long enough, the queue grows, memory may be exhausted, and users may experience timeouts. Backpressure is a deliberate mechanism that slows producers, limits concurrency, or rejects work before the system fails completely.

Retries can worsen an incident. A failed dependency may receive repeated retry traffic, increasing load and producing a feedback loop. Exponential backoff, bounded retries, idempotency, timeouts, and circuit breakers reduce this risk. A retry policy should be designed as part of capacity management, not added without considering its traffic multiplier.

4. Service-Level Objectives and Measurement Design

A service-level indicator (SLI) is a measured quantity, such as successful request ratio or p95 latency. A service-level objective (SLO) is the target value for an SLI. A service-level agreement (SLA) is a formal commitment, often with contractual consequences.

Examples include:

  • availability ≥ 99.9% per calendar month;
  • p95 checkout latency ≤ 500 ms;
  • successful payment requests ≥ 99.95%;
  • event processing delay below two minutes for 99% of events.

SLOs should define the population, time window, exclusions, measurement location, and aggregation method. Averages can hide tail behaviour, while a poorly chosen percentile can hide severe failures affecting a small but important group.

An error budget is the permitted amount of unreliability implied by an SLO. If the availability target is 99.9%, the monthly error budget is 0.1% of the agreed service time. Error budgets support balanced decisions: teams may release changes while the budget remains healthy, but reliability work should take priority when the budget is being consumed rapidly.

5. Load Testing and Performance Evaluation

Load testing is controlled experimentation that observes a system under defined demand. It should be conducted in an environment and dataset that represent production sufficiently for the conclusions being drawn.

5.1 Types of Tests

Test typePurpose
Baseline testEstablish normal performance under expected load
Load testVerify behaviour at anticipated demand
Stress testDetermine behaviour beyond expected demand
Spike testExamine sudden increases or decreases in demand
Soak testDetect leaks, degradation, and exhaustion over time
Capacity testFind the maximum sustainable workload meeting SLOs
Failover testAssess continuity when components or zones fail

5.2 Designing a Valid Test

A professional test plan specifies workload mix, request rates, concurrency, data volumes, geographic distribution, ramp-up period, duration, success criteria, and rollback safeguards. It also records the versions and configurations tested.

The test should capture:

  • traffic generated and successfully completed;
  • latency percentiles, not only averages;
  • error and timeout rates;
  • CPU, memory, disk, network, and connection utilization;
  • queue depth and consumer lag;
  • database locks, cache hit ratio, and query latency;
  • autoscaling actions and time to become effective;
  • cloud cost incurred by the test.

Synthetic tests should not expose real personal data. Load generation must be authorized because it can affect shared infrastructure and third-party providers.

5.3 Interpreting Results

A capacity boundary is reached when an SLO fails or when a critical resource enters an unsafe operating region. A test result such as “1,000 requests per second” is incomplete unless it states latency, errors, workload composition, and duration. A short burst may succeed while a two-hour soak test reveals memory growth.

6. Capacity Planning

Capacity planning connects expected demand to required resources. It includes forecasting, modelling, testing, provisioning, and reviewing assumptions.

6.1 Demand Forecasting

Demand may be estimated from historical traffic, business forecasts, seasonality, product launches, academic calendars, or marketing events. Forecasts should include uncertainty rather than a single confident number.

A simple growth projection is:

Dt = D0(1 + g)t

where D0 is the starting demand, g is the growth rate per period expressed as a decimal, and t is the number of periods. This model assumes a constant compound growth rate and is unsuitable where demand is strongly seasonal or discontinuous.

For example, demand of 10,000 requests per hour growing by 8% annually is projected after three years as:

D3 = 10,000 × (1.08)3 ≈ 12,597 requests/hour

This is a planning estimate, not a guarantee. Scenario analysis should also consider a high-demand case.

6.2 Headroom and Safety Margin

If a tested instance group supports 1,000 requests per second while meeting the SLO, an organization may plan to operate at only 70% of that tested limit. The 30% difference is headroom for variation, failover, scaling delay, and measurement uncertainty. The correct margin depends on workload volatility, recovery objectives, and the cost of spare capacity.

Headroom must be based on the limiting resource. Increasing server count does not solve a database connection limit unless database capacity and connection management are addressed.

6.3 Capacity Planning for Redundancy

Redundancy changes the calculation. A service requiring continued operation after losing one of three equal instances cannot plan to run all three at 90% utilization. After one fails, the remaining two must handle the workload while meeting their SLO. Capacity plans should model failure scenarios, not only normal operation.

7. Scaling Strategies

7.1 Vertical and Horizontal Scaling

Vertical scaling increases the size of an instance, such as adding CPU or memory. It is often simple but has upper limits, may require a restart, and can create a larger failure domain.

Horizontal scaling adds instances or workers. It can provide elasticity and fault isolation but requires stateless design, load distribution, shared or replicated state, and careful coordination.

Diagonal scaling combines both approaches. For example, a database may first be moved to a larger class and then supplemented with read replicas or sharding.

7.2 Reactive and Predictive Autoscaling

Reactive autoscaling responds to observed metrics such as CPU, request rate, queue length, or latency. It must account for metric delay, cooldown periods, instance startup time, and scale-in safety. Queue-based systems often scale more effectively on backlog per worker than on CPU alone.

Predictive scaling uses forecasts or scheduled policies. It can prepare for known peaks but may waste resources when forecasts are wrong. A robust design combines prediction with reactive safeguards.

Scaling policies should include stabilization. Rapid scale-out and scale-in oscillation, known as flapping, can increase cost and destabilize applications. Scale-in should protect in-flight work and respect graceful shutdown.

8. Right-Sizing and Cost Optimization

Right-sizing means matching resource type and quantity to the workload and required resilience. It is not equivalent to choosing the smallest instance. An apparently inexpensive configuration may increase latency, failure risk, or operational effort.

A right-sizing review should examine:

  1. utilization distributions rather than a single peak or average;
  2. memory pressure and swap activity;
  3. CPU throttling and burst-credit behaviour;
  4. storage IOPS, throughput, and latency;
  5. network traffic and egress charges;
  6. autoscaling boundaries;
  7. licensing and managed-service costs;
  8. redundancy and recovery requirements;
  9. performance test evidence;
  10. idle, unattached, duplicated, or overprovisioned resources.

Cost per unit of useful work is more informative than raw infrastructure cost:

Cost per transaction = Total service cost ÷ Number of successful transactions

The numerator should include the relevant period and cost components, while the denominator should count successful, comparable transactions. Reducing instance count may lower total cost but increase cost per successful transaction if errors and retries rise.

Optimization actions include changing instance families, scheduling non-production resources, adopting autoscaling, using storage tiers, improving cache hit rates, reducing unnecessary data transfer, deleting idle resources, and selecting purchasing commitments where demand is stable. Every optimization should be validated against performance, availability, security, and compliance requirements.

9. Worked Application: Illustrative Online Learning Platform

Background

Consider a fictional online learning platform used by a college. During normal periods it receives 120 requests per second. Before examinations, demand is expected to reach 240 requests per second, with a possible surge to 300 requests per second. The SLO is p95 page latency below 800 ms, availability of at least 99.9%, and an error rate below 0.2%.

Problem

The platform currently uses four application instances. A baseline test shows that four instances support 160 requests per second at p95 latency of 520 ms. At 200 requests per second, p95 latency rises to 1.1 seconds and database connection wait time increases sharply. CPU is only 62%, but the database connection pool is nearly full.

Analysis

The database connection pool, not CPU, is the limiting resource. Increasing application CPU would not remove the bottleneck. Tracing shows that each page request performs several synchronous database queries. A cache review finds a low hit ratio because cache keys contain unnecessary session-specific values. The database also performs repeated reads for course metadata.

Approach and Solution

The engineering team takes the following steps:

  1. Removes redundant queries and adds indexes based on query plans.
  2. Caches stable course metadata using a documented expiration policy.
  3. Separates read traffic using a read replica, while retaining the primary database for writes.
  4. Increases the application connection-pool limit only after confirming that the database can safely accept the additional connections.
  5. Configures horizontal autoscaling from four to ten instances using request rate and p95 latency, with a maximum chosen from capacity tests.
  6. Runs a soak test at 240 requests per second and a spike test at 300 requests per second.
  7. Adds alerts for p95 latency, database wait time, queue depth, error rate, and failed scaling actions.

Outcome

After optimization, four instances support 210 requests per second at p95 latency of 610 ms. Six instances support 300 requests per second at p95 latency of 690 ms, while the database remains below its tested safe connection limit. The platform is scheduled to scale to six instances before the examination period and can scale further if measured demand requires it. The team also estimates cost per successful request rather than judging the change solely by instance count.

Learning Points

The case demonstrates that utilization must be interpreted in context. CPU was moderate, yet the service was capacity-constrained by database connections and query efficiency. Performance improvement came from reducing work and improving dependency behaviour, not simply adding compute. Capacity planning also included failure limits, autoscaling delay, test evidence, and cost per useful outcome.

10. Observability, Governance, and Professional Practice

Effective management requires metrics, logs, traces, events, and context. Metrics reveal trends, logs provide detailed records, and traces connect a user request across services. Tags should identify service, environment, region, version, tenant where appropriate, and cost centre. Time synchronization and consistent units are essential.

Monitoring must avoid both blind spots and excessive noise. Alerts should be actionable, owned, prioritized, and linked to runbooks. Alert thresholds should reflect SLO risk rather than every minor fluctuation. A dashboard is not a substitute for an operational response process.

Privacy and governance are important. Request logs may contain identifiers, search terms, payment information, or educational records. Data minimization, access control, retention limits, encryption, masking, and audit trails should be applied. Monitoring should not become a mechanism for unjustified employee surveillance. Where automated systems classify incidents or recommend scaling, operators should understand the data, assumptions, confidence, and consequences of the recommendation.

Artificial intelligence and machine learning can support anomaly detection, forecasting, root-cause suggestions, and resource recommendations. However, automated conclusions may be affected by seasonal changes, incomplete telemetry, instrumentation errors, or feedback loops. AI recommendations should be tested, explainable enough for operational decisions, and subject to human approval for high-impact changes.

11. Challenges and Limitations

Several limitations affect availability, performance, and capacity work:

  • Metrics may be sampled, aggregated, or delayed.
  • Averages can conceal tail latency and local failures.
  • Test environments may differ from production.
  • Synthetic traffic may not reproduce real user behaviour.
  • Autoscaling cannot respond instantly to every demand spike.
  • Cloud-provider quotas can become hidden capacity limits.
  • Dependencies outside organizational control may dominate latency.
  • Forecasts are uncertain, especially for new products.
  • Cost data may arrive later than operational metrics.
  • Optimizing one service can transfer load or cost to another.

Consequently, capacity management is a continuous feedback process. Teams should establish a baseline, measure changes, test assumptions, review incidents, and revise forecasts.

Best-Practice Checklist

  • Define SLIs and SLOs from user and business requirements.
  • Monitor latency percentiles, traffic, errors, and saturation together.
  • Map dependencies and instrument critical paths.
  • Measure the actual bottleneck before scaling.
  • Test expected, peak, spike, and sustained workloads.
  • Include redundancy and failure scenarios in capacity plans.
  • Use headroom appropriate to volatility and recovery objectives.
  • Design autoscaling with startup time, cooldown, and graceful shutdown.
  • Right-size using utilization distributions and performance evidence.
  • Evaluate cost per successful unit of work.
  • Protect monitoring data through privacy and access controls.
  • Document assumptions, thresholds, ownership, and runbooks.
  • Review capacity after releases, architecture changes, and demand shifts.

Chapter Summary

Availability measures whether a service performs its intended function during an agreed period; performance concerns latency, throughput, errors, and efficiency; and capacity concerns the sustainable workload that can be supported while meeting defined objectives. The golden signals—latency, traffic, errors, and saturation—provide a practical foundation for diagnosis, but they must be interpreted with dependency maps and workload context.

Utilization is not identical to available capacity, and CPU is not always the bottleneck. Queues, connection pools, database locks, network limits, quotas, and third-party dependencies may constrain a system first. Little’s Law provides a useful relationship among in-flight work, throughput, and time, provided the system is stable and boundaries are clearly defined.

Load testing should measure realistic workload mixes, latency percentiles, errors, resource saturation, scaling behaviour, and cost. Capacity planning combines demand forecasts, tested limits, safety margins, redundancy requirements, and uncertainty. Vertical, horizontal, diagonal, reactive, and predictive scaling each have appropriate uses. Right-sizing should optimize useful outcomes while preserving SLOs, security, resilience, and compliance.

Professional practice depends on trustworthy observability, actionable alerts, documented runbooks, privacy protection, and continuous review. Automation and AI can assist forecasting and anomaly detection, but their recommendations require validation and governance.

Key Terms

Availability: Proportion of agreed service time during which a service performs its intended function.

Capacity: Maximum sustainable workload that meets specified performance and quality objectives.

Concurrency: Number of operations or users active at the same time.

Error budget: Permitted unreliability implied by a service-level objective.

Error rate: Proportion of operations that fail or produce invalid results.

Headroom: Unused capacity reserved for variation, failure, scaling delay, or uncertainty.

Latency: Time required to complete an operation.

Little’s Law: Relationship L = λW among average items, throughput, and average time in a stable system.

Load testing: Controlled testing under a specified workload.

p95 latency: Latency value at or below which 95% of observations fall.

Right-sizing: Matching resource type and quantity to workload and requirements.

Saturation: Condition in which a resource has little or no ability to accept additional work.

Scaling: Changing resource capacity to match workload demand.

Service-level agreement: Formal service commitment, often contractual.

Service-level indicator: Measured quantity used to assess service behaviour.

Service-level objective: Target value or range for a service-level indicator.

Throughput: Completed work per unit of time.

Utilization: Proportion of a resource’s available capacity being used.

Review Questions

Short Answer Questions

  1. Distinguish availability from reliability.
  2. What are the four golden signals of monitoring?
  3. Why can average latency be misleading?
  4. Define a bottleneck and give one example.
  5. What is the purpose of headroom in capacity planning?

Long Answer Questions

  1. Explain how utilization, throughput, latency, errors, and saturation should be interpreted together.
  2. Describe a method for designing and evaluating a capacity test for a cloud application.
  3. Compare vertical, horizontal, and diagonal scaling, including their principal advantages and limitations.
  4. Explain how dependencies, retries, queues, and backpressure can contribute to cascading failure.
  5. Discuss how right-sizing can reduce cost without compromising availability, performance, security, or compliance.

Analytical / Application Questions

  1. A service has an average of 240 requests in its system and completes 40 requests per second. Use Little’s Law to calculate average time in the system and explain what the result means.
  2. A platform has four instances that meet its SLO at 160 requests per second, but its expected peak is 240 requests per second. Propose a capacity-testing and scaling plan, including at least two risks that must be validated.
  3. During an incident, CPU is 55%, p95 latency is rising, database connection wait time is high, and the error rate is increasing. Identify the most likely investigation path and explain why adding application CPU may not solve the problem.

Multiple Choice Questions with Answers

Question 1

Which metric represents the proportion of operations that fail?

A. Throughput

B. Error rate

C. Utilization

D. Headroom

Correct Answer: B. Error rate

Question 2

A service has an agreed service time of 43,200 minutes and an availability target of 99.9%. Approximately how much unavailable time does the target permit?

A. 4.32 minutes

B. 43.2 minutes

C. 432 minutes

D. 4,320 minutes

Correct Answer: B. 43.2 minutes

Question 3

In Little’s Law, what does λ represent?

A. Average number of items in the system

B. Average time in the system

C. Average arrival or throughput rate

D. Resource utilization percentage

Correct Answer: C. Average arrival or throughput rate

Question 4

Which observation most strongly suggests that a database connection pool is a bottleneck?

A. Low latency and low connection wait time

B. Moderate CPU with sharply rising connection wait time

C. High cache hit ratio and stable queues

D. Declining traffic with no errors

Correct Answer: B. Moderate CPU with sharply rising connection wait time

Question 5

What is the primary purpose of a soak test?

A. To test only a sudden traffic spike

B. To identify long-duration degradation or resource exhaustion

C. To measure only the cost of storage

D. To verify a user’s password policy

Correct Answer: B. To identify long-duration degradation or resource exhaustion

Question 6

Which statement best describes horizontal scaling?

A. Increasing the size of one instance

B. Adding more instances or workers

C. Reducing all monitoring data

D. Changing a database from structured to unstructured storage

Correct Answer: B. Adding more instances or workers

Question 7

A system contains an average of 120 jobs and completes 30 jobs per second. What is the average time in the system?

A. 0.25 seconds

B. 2 seconds

C. 4 seconds

D. 3,600 seconds

Correct Answer: C. 4 seconds

Question 8

Why should p95 or p99 latency often be monitored in addition to average latency?

A. Percentiles measure cloud cost directly

B. Percentiles reveal slow-tail experiences hidden by averages

C. Percentiles eliminate the need for error metrics

D. Percentiles always equal maximum latency

Correct Answer: B. Percentiles reveal slow-tail experiences hidden by averages

Question 9

Which practice best supports safe autoscaling?

A. Ignoring startup time and cooldown periods

B. Scaling only after a total outage occurs

C. Considering startup time, stabilization, and graceful shutdown

D. Using CPU regardless of the actual bottleneck

Correct Answer: C. Considering startup time, stabilization, and graceful shutdown

Question 10

What is a sound principle of right-sizing?

A. Always select the smallest available instance

B. Optimize raw instance count without considering SLOs

C. Match resources to workload and resilience requirements using evidence

D. Remove redundancy to minimize monthly cost

Correct Answer: C. Match resources to workload and resilience requirements using evidence

Cloud Resource Monitoring and Cost Optimization
Chapter 5 of 14