04 · AWS Lambda Running Example: ShopFast Black Friday Canary, Warm Pools and Throttling

🇨🇳 中文版 | 📦 GitHub: https://github.com/geekchow/aws-lambda-guide

Where you are:Stage 4 of 6 (Running example).
After this file you will know:the one scenario every later file refers back to, and which component is on stage at each step — still without internals.


The scenario in three sentences

  1. OnThursday 2026-11-26, ShopFast’s team ships coupon support asversion 8of thecheckoutfunction, shifting theprodaliasfrom v7 to v8 by canary (10% for 10 minutes, then 100%).
  2. Before the sale opens onFriday 09:00, they raiseprovisioned concurrencyonprodfrom 50 to 400 so the first wave of shoppers never sees a cold start.
  3. At 09:05 a viral post pushes traffic beyond the warm pool: extra requestsspill overto cold on-demand environments, and at the very top a few arethrottledby the function’s reserved concurrency cap.

The cast (fixed facts used everywhere)

ItemValue
Account / Region111122223333/us-east-1
Functioncheckout, Node.js 22 runtime, 1,024 MB memory, 10 s timeout
CallerAPI (Application Programming Interface) Gateway REST API, integration ARN (Amazon Resource Name)arn:aws:lambda:us-east-1:111122223333:function:checkout:prod
Versionsv7 (current), v8 (new, coupons)
Aliasprod→ v7, PC (Provisioned Concurrency) = 50
Reserved concurrency800 (socheckoutcan never starve other functions, nor be starved)
Average duration150 ms warm; cold Init ≈ 600 ms
Account concurrency quota3,000

Three named requests we follow:

RequestWhenFate
Alice’s checkoutThu 14:05, during the canaryLands on v8 (the 10%), served by a warm PC environment
Bob’s checkoutFri 09:05, the viral spikePC pool full → spillover → cold start on a new v8 environment
Carol’s checkoutFri 09:06, the very peakReserved concurrency of 800 reached →429throttle; API Gateway returns an error, the client retries

The scenario traced shallowly

Question it answers: in what order do the players appear across the week?

Friday: the sale

08:30 Auto Scaling sets
PC to 400

Placement boots 400
v8 envs, Init runs

09:00 2,000 RPS,
300 concurrent: all warm

09:05 Bob: PC full,
spillover cold start

09:06 Carol: 800 cap hit,
429 throttle

Thursday: deploy

CI updates code of
$LATEST

Version store publishes
v8

Alias prod becomes
v7 90 / v8 10

PC manager splits warm
pool across v7 and v8

Alice request routed
to v8, warm env

Alarms quiet:
prod = v8 100

Caption: the week in ten steps — the spine every depth dive anchors to.

Thursday — deploying v8

  1. (T1–T2)The CI/CD (Continuous Integration / Continuous Delivery) pipeline uploads the new zip to thefunction’s$LATEST, then callsPublishVersion. TheVersion storefreezes code + config asversion 8.
  2. (T3)CodeDeploy updates thealiasprod: primary v7, additional version v8 with weight 0.10. API Gateway’s integration still sayscheckout:prod— nothing on the caller side changes.
  3. (T4)Becauseprovisioned concurrencyis configured onprod, thePC managernow keeps warm environments forbothversions, roughly in proportion to the weights.
  4. (T5)Aliceclicks “Pay”. API Gateway invokescheckout:prod. TheInvoke Frontendauthenticates the call, thealias routerrolls the weighted dice → v8. TheCounting serviceconfirmscheckoutis under its limits. TheAssignment servicefinds an idle, pre-initialized v8execution environmentand the handler runs in ~150 ms. No cold start.
  5. (T6)Ten quiet minutes later CodeDeploy setsprod→ v8 at 100%. (Had errors spiked, it would have set the weight back to 0 — a rollback in seconds.)

Friday — the sale

  1. (F1–F2)At 08:30 a scheduled action inApplication Auto Scalingraises PC onprodto 400. ThePC managerasksPlacementfor 400 v8 environments; each runs itsInitphase now, not during a request.
  2. (F3)At 09:00, 2,000 RPS (Requests Per Second) × 0.15 s ≈300 concurrentinvocations. Every one lands on a warm PC environment.
  3. (F4)At 09:05 traffic jumps to ~4,500 RPS → ~675 needed. The 400 PC environments are busy;Bob’s request is admitted by Counting (675 < 800) but the Assignment service has no idle environment, soPlacementcreates a new on-demand v8 environment. Bob waits ~600 ms extra: acold start(aspilloverinvocation).
  4. (F5)At 09:06 demand briefly needs ~850.Carol’s request is the 801st concurrent one; theCounting servicerejects it with429.

What each step touches

Concept / playerSteps
Function /$LATEST1
Version (Version store)1, and every later step runs “v8”
Alias (alias router)2, 4, 5
Provisioned concurrency (PC manager + Auto Scaling)3, 6, 7, 8
Invocation & concurrency (Frontend + Counting)4, 7, 8, 9
Assignment + Placement4, 6, 8
Execution environment4, 6, 7, 8

Test yourself:without scrolling up, who rejects Carol, and why isn’t that the PC manager’s job? (Answer: the Counting service, because PC never caps traffic — it only pre-warms.)


Next →05.1 Versions ·Back to03 Concept map


📚 Back to series index

相关新闻

谷歌/google shopping 协议采集分析

谷歌/google shopping 协议采集分析

声明 本文章中所有内容仅供学习交流使用&#xff0c;不用于其他任何目的&#xff0c;抓包内容、敏感网址、数据接口等均已做脱敏处理&#xff0c;严禁用于商业用途和非法用途&#xff0c;否则由此产生的一切后果均与作者无关&#xff01; 有相关问题请第一时间点击头像看简介或…

2026/10/20 2:19:26 阅读更多 →
Cherry Studio接入牧马人本地模型:离线部署与调优实战指南

Cherry Studio接入牧马人本地模型:离线部署与调优实战指南

聊聊最近在折腾的一件事&#xff1a;用 Cherry Studio 接牧马人&#xff08;Herdsman&#xff09;本地模型&#xff0c;把日常对话、写作、代码辅助这些场景挪到完全离线的环境里跑。折腾完最大的感受是&#xff0c;本地离线推理已经不是“能不能用”的问题&#xff0c;而是“怎…

2026/10/20 2:19:26 阅读更多 →
一周两条官方MCP大新闻,Aave之后TradingView也下场了:AI盯盘时代真的来了

一周两条官方MCP大新闻,Aave之后TradingView也下场了:AI盯盘时代真的来了

一周两条官方MCP大新闻&#xff0c;Aave之后TradingView也下场了&#xff1a;AI盯盘时代真的来了 【免费下载链接】tradingview-mcp AI-assisted TradingView chart analysis — connect Claude Code to your TradingView Desktop for personal workflow automation 项目地址…

2026/10/20 2:19:26 阅读更多 →

最新新闻

从URL取参到Cookie操作:前端开发完整指南与踩坑记录

从URL取参到Cookie操作:前端开发完整指南与踩坑记录

老读者可能还记得&#xff0c;我之前在某公司的运营后台系统里做过一次页面重构&#xff0c;其中有个特别不起眼但又绕不开的需求&#xff1a;从前端拿 URL 上携带的参数&#xff0c;顺手把一些状态写进 Cookie。听起来简单&#xff0c;真正动手的时候才发现&#xff0c;这里面…

2026/10/20 2:54:46 阅读更多 →
不复杂的复杂度:Java开发者必备的大O分析指南

不复杂的复杂度:Java开发者必备的大O分析指南

第八篇了。前面我们用了几篇的篇幅&#xff0c;把Java的语法、面向对象、集合框架、I/O、异常这些基础内容过了一遍。今天想插一个看起来不太一样、但实际非常重要的主题——复杂度分析。为什么在这个节点讲它&#xff1f;因为我发现很多人在前面那些内容学完之后&#xff0c;开…

2026/10/20 2:54:46 阅读更多 →
需求分级与优先级管理:产研团队高效协作的落地指南

需求分级与优先级管理:产研团队高效协作的落地指南

周五下午三点&#xff0c;我正在跟团队过下一迭代的排期。会议室的门被推开&#xff0c;某业务线负责人带着一份PPT走进来&#xff0c;说有一位大客户急需一个定制功能&#xff0c;客户已经在催&#xff0c;下周要看到演示&#xff0c;否则可能影响续约。会议室安静了几秒&…

2026/10/20 2:54:46 阅读更多 →
降AI率工具实测:九类工具原理、风险与一套可复用工作流

降AI率工具实测:九类工具原理、风险与一套可复用工作流

开头部分可以这么写&#xff1a;最近不少本科生来找我看论文初稿&#xff0c;十份里有八份开头都是“随着社会的不断发展”&#xff0c;第二段必是“综上所述”。一问才知道&#xff0c;都是让AI先写一版&#xff0c;自己再改&#xff0c;改完一检测&#xff0c;“AI率”飙到百…

2026/10/20 2:54:46 阅读更多 →
Llama 2 提示词完全指南:模板、参数与实战技巧

Llama 2 提示词完全指南:模板、参数与实战技巧

最近几周我一直在折腾基于 Llama 2 的几个实际项目&#xff0c;从本地部署到 API 接入都走了一遍。反复试下来发现一个很多人容易忽略的事实&#xff1a;Llama 2 和 GPT 系列这类闭源模型的对话习惯差异非常大&#xff0c;直接把原来惯用的提示词搬过去&#xff0c;效果会肉眼可…

2026/10/20 2:54:46 阅读更多 →
大模型Skills应用实战:在Trae中把提示词变成可复用工作流

大模型Skills应用实战:在Trae中把提示词变成可复用工作流

这个系列写到第14篇&#xff0c;我聊点真正能提效的东西——大模型Skills应用。之前几篇要么在讲模型能力边界&#xff0c;要么在讲上下文工程&#xff0c;这次把视角落到一个具体场景&#xff1a;在Trae这款AI原生IDE里&#xff0c;怎么把Skill从"听说过"变成"…

2026/10/20 2:53:45 阅读更多 →

日新闻

CLRC663芯片Pin-to-Pin替代实战:从评估到量产全记录

CLRC663芯片Pin-to-Pin替代实战:从评估到量产全记录

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

2026/10/20 1:01:30 阅读更多 →
ESP32舵机控制指南:原理、多路驱动与避坑实战

ESP32舵机控制指南:原理、多路驱动与避坑实战

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

2026/10/20 1:01:30 阅读更多 →
位移法实现一阶低通滤波:单片机ADC采样降噪实战

位移法实现一阶低通滤波:单片机ADC采样降噪实战

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

2026/10/20 1:01:30 阅读更多 →

周新闻

基于GMM的语音识别系统原理与MATLAB实现详解

基于GMM的语音识别系统原理与MATLAB实现详解

说到基于高斯混合模型&#xff08;GMM&#xff09;的语音识别系统&#xff0c;很多人第一反应就是一堆数学公式&#xff0c;觉得门槛很高。但如果你真的在MATLAB里把它落地跑通&#xff0c;会发现核心其实就是三件事&#xff1a;把声音变成特征向量&#xff0c;用GMM给每个类别…

2026/10/19 10:02:04 阅读更多 →
数字图像处理入门:反白、灰度化、调色板修改与导出txt实践

数字图像处理入门:反白、灰度化、调色板修改与导出txt实践

数字图像处理这四个字听起来挺唬人&#xff0c;但落到具体操作上&#xff0c;无非就是让计算机按你的想法“摆弄”像素。我在一个模拟项目X里用了一套特别经典的基础处理流程&#xff1a;对图像做反白、改调色板、彩色转灰度&#xff0c;最后把像素数据导出成txt文件。单看每一…

2026/10/19 17:32:41 阅读更多 →
机器人大脑技术盘点:具身智能的感知、决策与数据闭环

机器人大脑技术盘点:具身智能的感知、决策与数据闭环

如果你的信息流最近也天天刷到“机器人大脑”这个词&#xff0c;你会发现一个很有意思的现象&#xff1a;每个人说的“大脑”根本不是同一个东西。有人指的是大语言模型&#xff0c;有人指的是运动控制系统&#xff0c;还有人指的是能理解物理世界的端到端模型。在2026年这个时…

2026/10/20 2:50:50 阅读更多 →

月新闻

我发现了一个新思路:用 Remotion + Claude Code 像写代码一样自动化生成短视频

我发现了一个新思路:用 Remotion + Claude Code 像写代码一样自动化生成短视频

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

2026/10/19 2:54:50 阅读更多 →
Windows下 Codex 中 Chrome 和 Computer Use 插件不可用问题排查及解决参考方式:TaoToken 统一 Key 配置与验证

Windows下 Codex 中 Chrome 和 Computer Use 插件不可用问题排查及解决参考方式:TaoToken 统一 Key 配置与验证

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

2026/10/19 9:10:22 阅读更多 →
黑夜航拍船只数据集训练YOLOV5模型全流程解析

黑夜航拍船只数据集训练YOLOV5模型全流程解析

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

2026/10/18 12:16:16 阅读更多 →