INFRASTRUCTURE LEARNINGINFRASTRUCTURE LEARNING
インフラ大全インフラ大全IT INFRASTRUCTURE / LEARNING
Infrastructure learning guide
Find a lesson or lab/

Esc to close · Search terms stay on your device

LEARNING日本語

Topic lessonTopic: Designing event-driven processing

Trace serverless operating costs across Lambda, SQS, and CloudWatch Logs

Retries and log output can increase usage even when the number of business requests stays constant. Follow an image-processing example and examine Lambda invocations and duration, SQS API requests, and CloudWatch Logs ingestion and storage.

What you will learn

Compare business volume and service usage over matching intervals. Trace whether retries, execution time, or increased log volume contributed to a usage increase.

Prerequisite

This scenario uses SQS to buffer work and Lambda to process it. The measurements are fictional. They illustrate usage patterns without estimating a bill or changing any configuration.

Follow work through the services that meter usage

Three kinds of usage from one image-processing job
Three kinds of usage from one image-processing job1: Image intake — Submits the job — SQS queue. 2: SQS queue — Hands received messages to the worker — Lambda worker. 3: Lambda worker — Writes processing logs — CloudWatch Logs123Image intakeSQS queueLambda workerCloudWatch LogsThree kinds of usage from one image-processing job1: Image intake — Submits the job — SQS queue. 2: SQS queue — Hands received messages to the worker — Lambda worker. 3: Lambda worker — Writes processing logs — CloudWatch Logs123Image intakeSQS queueLambda workerCloudWatch Logs
  1. Image intake → SQS queueSubmits the job
  2. SQS queue → Lambda workerHands received messages to the worker
  3. Lambda worker → CloudWatch LogsWrites processing logs
Image intake
Counts business requests
SQS queue
Send, receive, and delete actions
Lambda worker
Invocation count and execution time
CloudWatch Logs
Ingestion and stored volume
Business requests and billed usage use different units
ServiceEvidence to checkWhat can increase usage
LambdaInvocation count, execution time, and memory settingRedelivery or dependency delays can add invocations or increase duration.
SQSAPI requests and message payload sizesRedelivery, empty receives, and batching affect operations per job.
CloudWatch LogsIngestion, storage, and bytes scanned by queriesVerbose logging adds input. Retention changes stored volume.

Compare the same measures across two one-hour windows

Fictional observations before and during an incident
MeasureBeforeDuring
Accepted requests1,0001,000
Lambda invocations100170
Total SQS messages received1,0001,600
Log ingestion20 MB85 MB

Accepted requests stayed constant while received messages and function invocations rose. The receive metric can count redeliveries. The number of received messages is a different measure from billable API requests. Correlate request IDs with processing results to see whether the same work ran again.

Log ingestion rose to 85 MB. Identify the added output, such as repeated error details. Retention changes stored volume while previously ingested bytes remain part of measured ingestion. Inspect ingestion, storage, and query usage separately.

Identify the cause and verify recovery before tuning

Use matching periods and resources to compare accepted and completed work, redeliveries, execution time, and log volume. Fix the cause of continuing errors and confirm that replay can avoid repeating business effects. Preserve the records needed for investigation when you adjust log output, then monitor ingestion.

Choose the next evidence to check

Choose an option to see the result and explanation.

SQS reports 1,600 messages received during the incident. What does that count represent?
Read the answer and reason

Answer: The total number of received messages · The count can include repeated receipt of the same message.

Log ingestion increased. What does a shorter retention period primarily change?
Read the answer and reason

Answer: The volume of logs stored going forward · A retention setting determines how long stored logs are kept.

Intake is steady while Lambda invocations and redeliveries rise. What do you compare first?
Read the answer and reason

Answer: Request IDs, failure records, and processing outcomes · Trace the same work from receipt through completion.

Invocation count is steady, but Lambda runs take longer. Which measures do you examine?
Read the answer and reason

Answer: Execution time and configured memory · Execution time and memory configuration affect Lambda usage.

Check, then explain in your own words

  1. Choose comparable intervals and resources before and during the incident.
  2. Record intake, redeliveries, execution time, and log ingestion in their own units.
  3. Connect the changed usage to configuration and the associated billing line items.
Check your understanding: Lambda invocations dropped after an incident. What else would show recovery?

Check successful work completions and confirm that backlog and failure signals have improved.

Invocations can fall when the worker is unable to receive jobs. Compare completions and waits alongside changes in log volume and cost.

Sources and conditions checked

The official references used in this lesson are collected here with their scope, conditions and corresponding sections. Independent expert review and live AWS comparison have not been performed.