Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
AWS · DVA-C03

Concurrency, compute, and messaging

DVA-C03 · Lesson 23 of 24 · 3:09:58

YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗

Learning with these videos? Subscribe for new courses and exam-style questions.

In this lesson

Prepare for the DVA-C03 exam (AWS Certified Developer – Associate). In this lesson: Lambda concurrency, reserved and provisioned concurrency, throttling, EC2 Auto Scaling, connection pools and RDS Proxy, memory, arm64 and Graviton, SnapStart, SQS long polling, batching, and visibility timeouts, and SNS fan-out with filter policies. Includes three original practice questions.

Study notes

The text of this lesson, to read at your own pace. Information as of November 2026.

Three problems at once

When the presale opened, AnyCompany Tickets saw three problems at once. The first requests waited for cold starts, the database ran out of connections, and the queue of order emails kept growing for an hour. This lesson covers Lambda concurrency, scaling and pools, memory and compute, and messaging.

Lambda concurrency

Concurrency is the number of requests that a function handles at the same time: one hundred requests per second, at half a second each, need a concurrency of fifty. By default, all the functions in a Region share a quota of one thousand concurrent executions, which you can raise, and each function scales by one thousand execution environments every ten seconds. Reserved concurrency sets aside a part of that pool for one function and caps it at the same value, at no extra charge, which protects a database behind the function, or keeps other functions from using up its share. Provisioned concurrency keeps execution environments initialized before requests arrive, on a version or an alias, which removes cold starts for an extra charge, and you can schedule it or scale it to a target utilization. And when a function is throttled, synchronous callers get a 429 error, while asynchronous events are retried for up to six hours.

Scaling and pools

Outside Lambda, EC2 Auto Scaling adds and removes instances: a target tracking policy keeps a metric near a value, like an average CPU of fifty percent, scheduled scaling prepares for a known peak, and predictive scaling learns from past traffic. Inside your code, concurrency comes from thread pools and connection pools, which you size to what each dependency can take, instead of opening a thread or a connection for every request. In Lambda, create SDK clients and database connections outside the handler, so that each execution environment reuses them across invocations. And when hundreds of environments connect to the same RDS or Aurora database, RDS Proxy keeps a pool of connections and shares it, so that the database is not overwhelmed.

Memory and compute

In Lambda, memory is the one dial for compute: you set it between one hundred twenty-eight megabytes and ten gigabytes, and CPU grows in proportion, with one full vCPU at one thousand seven hundred sixty-nine megabytes. A function limited by CPU can run much faster with more memory, and since you pay for duration, it may not cost more, so measure with the REPORT line, or with the open-source Lambda Power Tuning tool, which tries several memory settings. With the arm64 architecture, functions and EC2 instances run on Graviton processors, built for better price performance, once you check that your dependencies support arm64. For Java, Python, and .NET, SnapStart resumes new execution environments from a cached snapshot of an initialized one, which shortens cold starts. And on EC2 or in containers, pick the instance family that matches the bottleneck, compute, memory, or general purpose, and size tasks from their measured CPU and memory.

Messaging

Messaging has its own tuning. With SQS, long polling waits up to twenty seconds for messages, which cuts empty responses and cost, and batch actions send, receive, or delete up to ten messages in one call. When Lambda reads a queue, a larger batch size with a batch window means fewer invocations, partial batch responses return only the failed messages to the queue, and maximum concurrency caps how many functions the queue can invoke at once. Set the visibility timeout of the queue to at least six times the timeout of the function, so that messages are not delivered again while they are still in progress. And with SNS fan-out, one message published to a topic reaches several SQS queues, each with its own consumers, and filter policies send each subscriber only the messages that it needs.

Recap

Let's recap. Lambda concurrency is shared in each Region: reserved concurrency sets aside and caps it, and provisioned concurrency removes cold starts. EC2 Auto Scaling tracks targets, follows schedules, or predicts traffic, while pools and RDS Proxy reuse threads and connections. Memory sets the CPU of a function, arm64 runs on Graviton, and SnapStart shortens cold starts. SQS tuning uses long polling, batches, partial batch responses, and a visibility timeout of six times the function timeout. And SNS fan-out, with filter policies, gives each service its own queue.

Quick checks for this lesson

The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.

  1. The first purchases of the morning take three seconds, because a Java function has to initialize. The slow start must disappear for the 9 am sale, whose time is known in advance. What should the developer configure?

    • Reserved concurrency of 500 for the function
    • Provisioned concurrency on an alias, scheduled
    • A larger batch size on the event source
    • A longer timeout for the function
    Show the answer

    Provisioned concurrency on an alias, scheduled

    Provisioned concurrency initializes environments before the requests arrive, and a schedule raises it before the sale. “Reserved concurrency of 500 for the function” would set aside and cap concurrency, while each new environment still has to initialize. “A larger batch size on the event source” would change how many queue messages reach one invocation. And “A longer timeout for the function” would let slow invocations run longer, without making them faster.

  2. A function that resizes ticket images runs for eight seconds at 128 MB. Its REPORT line shows 90 MB of maximum memory used, and its CPU is the bottleneck. What should the developer try first?

    • Reserved concurrency for the function
    • A lower memory setting, since memory is unused
    • Provisioned concurrency on an alias
    • A higher memory setting, then measure again
    Show the answer

    A higher memory setting, then measure again

    CPU grows with memory, so a higher setting gives the function more CPU, and the REPORT line shows whether it pays off. “Reserved concurrency for the function” would set aside and cap concurrency, with the same CPU. “A lower memory setting, since memory is unused” would give the function even less CPU. And “Provisioned concurrency on an alias” would remove cold starts, while each invocation stays just as slow.

  3. One order event must reach three services: email, analytics, and fraud checks. Each service must process it at its own pace, even while another one is down. What should the developer use?

    • An SNS topic, with one SQS queue per service
    • One SQS queue that all three services read
    • Long polling on a single SQS queue
    • Synchronous calls to each of the services
    Show the answer

    An SNS topic, with one SQS queue per service

    SNS fan-out copies the event to one queue per service, and each queue keeps it until its service processes it. “One SQS queue that all three services read” would deliver each message to only one of the three consumers. “Long polling on a single SQS queue” would reduce empty responses, with the same single queue. And “Synchronous calls to each of the services” would make the order function wait for the three services, and fail when one of them is down.