#Autoscale
Mientras tanto, en un pequeño cubículo, Jebediah 'Jeb' Burnett, lee nervioso un email, dudando si borrarlo o marcarlo como spam levantará sospechas.

"The Copilot Agent 'Outlook autoscale' has run out of tokens, if you don't take action in 7 days, it will downgrade to model gpt-3.5-mini-aliexpress".
November 13, 2026 at 1:45 PM
Without a cap on how many live nodes a single token can authorize, a bug in your autoscale script can accidentally spawn hundreds of instances, leading to a massive billing surprise. 2/3
November 18, 2026 at 8:55 PM
Future of inference is agentic self tuning and its nice to know both Together and Inferact have adopted this. Historically when software had to autoscale the only factor was the net traffic scaling linearly. Its very easy to extrapolate the autoscaling based on linear functions
November 18, 2026 at 8:04 PM
Autoscale consumers on queue depth: the queue hits zero, the database hits error 10928.

20 instances x 16 concurrent calls = 320 handlers. An Azure SQL S2 allows 120 workers.

Lower concurrency to 4 and Functions asks for 80 instances. Cap both.
November 11, 2026 at 7:05 PM
Konsolen laden GTA VI ab dem 10.11. vor, damit am 19.11. niemand wartet. Mit Azure Autoscale geht das auch für Kapazität: ein Profil für ein festes Datum, und die Instanzen stehen vor dem Ansturm. ⏳

📚 https://learn.microsoft.com/en-us/azure/azure-monitor/autoscale/autoscale-multiprofile
November 10, 2026 at 8:01 PM
Day 2: Advanced Docker for AI — Multi-Stage Builds for Heavy Python Runtimes
Containerising an AI workload is a different problem from containerising a web service. The dependencies are huge, the build tools are heavy, and an unoptimised image can pass **10 GB**. Moving that across a registry slows every CI/CD run, and during a Kubernetes autoscale event each new pod must pull it before it can serve a single request. ## The naive Dockerfile This is the Dockerfile most teams start with. FROM python:3.11 RUN apt-get update && apt-get install -y build-essential gcc RUN pip install torch transformers fastapi uvicorn COPY . /app WORKDIR /app CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"] It works, and it has three production problems. > **Diagram:** FIG 1 · A single-stage build carries compilers, caches and wheels into production. Layer sizes here are illustrative, not measured. See the animated version. * **Build artifact accumulation.** Compilers, intermediate wheels and pip caches are baked into read-only image layers and shipped everywhere. * **Excessive attack surface.** Development and compilation tools exist in production, which gives an attacker more to work with after a break-in. * **Deployment latency.** Pulling a large image can take minutes, which causes request timeouts while new pods start. ## The multi-stage fix Keep the build dependencies in an ephemeral **builder** stage. Copy only the compiled output into a minimal **runtime** stage. > **Diagram:** FIG 2 · Dependencies are built in stage 1. Only the finished virtual environment is copied into the clean runtime stage; everything else is discarded. See the animated version. > # syntax=docker/dockerfile:1 # ---- Stage 1: builder (heavy, discarded) ---- FROM python:3.11-slim AS builder WORKDIR /build RUN apt-get update \ && apt-get install -y --no-install-recommends build-essential curl \ && rm -rf /var/lib/apt/lists/* RUN python -m venv /opt/venv ENV PATH="/opt/venv/bin:$PATH" COPY requirements.txt . RUN --mount=type=cache,target=/root/.cache/pip \ pip install --no-cache-dir -r requirements.txt # ---- Stage 2: runtime (small, ships to production) ---- FROM python:3.11-slim WORKDIR /app RUN apt-get update \ && apt-get install -y --no-install-recommends libgomp1 \ && rm -rf /var/lib/apt/lists/* COPY --from=builder /opt/venv /opt/venv ENV PATH="/opt/venv/bin:$PATH" RUN useradd -m -u 10001 aiuser USER aiuser COPY --chown=aiuser:aiuser ./src /app EXPOSE 8000 CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"] Build it with BuildKit enabled, which current Docker versions use by default: `docker build -t model-api:1.0 .`. A few notes on this file: * The cache mount (`--mount=type=cache`) keeps pip's download cache **outside** the image, so repeat builds in CI do not re-download multi-gigabyte wheels. Because the cache is not in the layer, `--no-cache-dir` here only avoids writing a second copy. * `libgomp1` is the OpenMP runtime that many numerical libraries need at run time. If your stack needs other shared libraries, install them in the runtime stage too, otherwise the app fails to start with a missing `.so` error. * If you need GPU support, use a CUDA-enabled base image for both stages, or install a CUDA build of PyTorch. That is the subject of Day 3. ## Image hygiene checklist > **Diagram:** FIG 3 · Five small habits that keep AI images lean and safe. Do the apt cleanup in the same RUN command, or the deleted files still live in an earlier layer. See the animated version. 1. Add a `.dockerignore` listing `.git`, `.venv`, `__pycache__` and raw test data, so the build context stays small and secrets do not leak in. 2. Run as a non-root user (`USER aiuser`). 3. Clean package caches in the **same** `RUN` command that created them. Deleting files in a later layer does not shrink the image, because the earlier layer still holds them. > **Diagram:** FIG 4 · Smaller images start faster. The sizes and network speed are illustrative inputs to simple arithmetic, so measure your own registry and network. See the animated version. Image size is not vanity. At 100 MB/s, an 8 GB image takes about 80 seconds to pull and a 2.5 GB one about 25 seconds, and during a scale-up every new node pays that cost. Lean, deterministic images turn research dependencies into a repeatable, auditable artifact that a cluster scheduler can start quickly. ## Run it yourself This is the exact example from the video. Both images are really built and measured with Docker. The 100 MB random file in the builder stage stands in for compilers and wheels, so the size gap is real but exaggerated on purpose. # syntax=docker/dockerfile:1 # ---- builder: heavy, thrown away ---- FROM alpine:3.20 AS builder WORKDIR /build RUN dd if=/dev/urandom of=toolchain.bin bs=1M count=100 RUN echo "model-api v1" > app.txt # ---- runtime: small, ships ---- FROM alpine:3.20 RUN adduser -D -u 10001 aiuser USER aiuser COPY --from=builder /build/app.txt /app/ CMD ["cat", "/app/app.txt"] Helper file `Dockerfile.naive`, used by the run: FROM alpine:3.20 WORKDIR /build RUN dd if=/dev/urandom of=toolchain.bin bs=1M count=100 RUN echo "model-api v1" > app.txt CMD ["cat", "/build/app.txt"] Helper file `compare.sh`, used by the run: set -e docker build -q -f Dockerfile.naive -t d2naive . >/dev/null docker build -q -t d2lean . >/dev/null echo "naive image: $(( $(docker save d2naive | wc -c) / 1000000 )) MB" echo "multi-stage: $(( $(docker save d2lean | wc -c) / 1000000 )) MB" echo "app says: $(docker run --rm d2lean)" echo "runs as uid: $(docker run --rm d2lean id -u)" docker rmi d2naive d2lean >/dev/null Run it: bash compare.sh Output I got while recording the video: naive image: 108 MB multi-stage: 3 MB app says: model-api v1 runs as uid: 10001 ## Coming Up Next **Day 3:** Hardware acceleration in Docker: configuring GPU passthrough and resource limits for constrained hardware. # Docker #Containerization #DevOps #AIEngineering #FastAPI #CloudNative #PlatformEngineering #CyberSecurity _Originally published at https://sureshpallapothu.in/blog/ai-int-day-2-advanced-docker, where this post includes animated diagrams._
dev.to
November 8, 2026 at 6:37 PM
Karpenter provisions Kubernetes nodes per unschedulable pod and can replace them via five disruption paths (consolidation, drift, expiration, interruption, repair)—including batching, binpacking, and 60-instance-type EC2 Fleet calls. 🚀☁️ #Kubernetes #Autoscaling #DevOps #AWS #CloudNative
What Is Karpenter and How Does It Autoscale Kubernetes Nodes
Karpenter watches for pods the scheduler could not place, works out the cheapest machine that would fit them, and asks the cloud for it. This article follows that decision all the way through.
kodekloud.com
November 5, 2026 at 12:39 AM
Amazon RDS for Oracle and SQL Server now support storage autoscaling on additional storage volumes

AWS finally lets RDS autoscale storage on extra volumes after years of making you guess capacity needs. "Zero downtime" they brag, as if not breaking things is an achievement worth a press release.
October 29, 2026 at 8:03 PM
🆕 Amazon RDS for Oracle and SQL Server now autoscale storage up to 256 TiB without downtime. It adjusts capacity based on usage, eliminating manual provisioning, reducing costs, and minimizing downtime. Available in all commercial AWS regions.

#AWS #AmazonRds
Amazon RDS for Oracle and SQL Server now support storage autoscaling on additional storage volumes
Amazon RDS for SQL Server and Amazon RDS for Oracle now support RDS storage autoscaling on additional storage volumes. RDS storage autoscaling automatically scales storage capacity in response to growing database workloads, with zero downtime. Additional storage volumes allow you to add up to three additional volumes to increase your storage capacity up to 256 TiB. Previously, you had to manually provision storage capacity on the additional storage volumes based on anticipated application capacity demands while autoscaling could be enabled on the primary storage volume. Under-provisioning could result in application downtime, and over-provisioning could result in under-utilized resources and higher costs. With RDS storage autoscaling, you simply set your desired maximum storage limit for each additional storage volume, and autoscaling takes care of the rest. RDS storage autoscaling continuously monitors actual storage consumption, and scales capacity up automatically when actual utilization approaches provisioned storage capacity. Autoscaling works with new and existing database instances. Autoscaling has no additional charges and you only pay for the provisioned storage resources. You can enable it by using the AWS Management Console, AWS CLI, or Amazon RDS API. RDS storage autoscaling for additional storage volumes is available for Amazon RDS for SQL Server and Amazon RDS for Oracle in all commercial AWS Regions and the AWS GovCloud (US) Regions. To learn more, please visit the Amazon RDS storage autoscaling documentation.
aws.amazon.com
October 29, 2026 at 8:10 PM
If you're nasty, you can even set it up to autoscale. How much will it cost? Who knows!
October 23, 2026 at 4:04 PM
This article walks through a real-time object detection pipeline where Kafka absorbs bursty camera traffic, YOLOv8 workers autoscale on Kubernetes, and MLflow tracks every model version

➜ https://ku.bz/vKPdn6ST4
October 21, 2026 at 7:26 PM
📦 cboxdk/laravel-queue-autoscale v4.6.1

Intelligent, predictive autoscaling for Laravel queues with SLA/SLO-based optimization

🔗 https://github.com/cboxdk/laravel-queue-autoscale
October 17, 2026 at 10:59 AM
Endpoint Incident Response & Forensics Playbook
You see a high-severity EDR detection, an elevated account used off-hours, or rapid file modifications on a user laptop. The SOC is noisy, the desktop owner is anxious, and the evidence you need — process memory, live network sockets, volatile handles — degrades with every reboot, VPN drop, or cloud autoscale event. The real problem is not that you lack tools; it's that the first responders often choose speed over preservation and destroy the very artifacts that prove scope and root cause. Contents * Real-time detection and remote triage * Containment that preserves evidence and operations * Forensic evidence collection: live capture and persistent artifacts * Memory analysis to reveal in-memory implants and secrets * Practical playbook: checklists, commands, and runbook templates ## Real-time detection and remote triage The fastest path to damage control is a short, repeatable remote-triage loop: confirm, scope, preserve, and decide. NIST’s incident handling model maps detection → analysis → containment → eradication → recovery; use it as the decision backbone for every endpoint incident. (nist.gov) * Confirm the signal: validate the alert against asset inventory, recent change windows, and identity logs. Pull the EDR alert JSON and timeline and correlate with authentication logs and VPN logs. * Scope quickly: determine the host’s role (user laptop, developer build server, domain controller, VDI), its network segment, and service dependencies. Use CMDB/asset-tag attributes to decide containment posture. * Preserve the blast radius: stop lateral movement vectors first — credential reuse, open remote sessions, and file shares. * Remote triage checklist (first 0–10 minutes): * Query EDR for detection details (detection name, SHA256, process tree). * Fetch short-lived telemetry: process tree, network connections, loaded modules, active logon sessions, and open sockets. * Record response IDs, timestamps (UTC), and operator names in the incident ticket. Quick triage commands (run remotely or via EDR live response): # Windows quick artifact snapshot Get-Process | Select-Object Id,ProcessName,StartTime,Path | Export-Csv C:\Temp\proc.csv -NoTypeInformation netstat -ano | Out-File C:\Temp\netstat.txt wevtutil epl System C:\Temp\System.evtx wevtutil epl Security C:\Temp\Security.evtx Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational';StartTime=(Get-Date).AddHours(-1)} | Export-Clixml C:\Temp\sysmon_last_hour.xml # Linux quick snapshot ps auxww --sort=-%mem | head -n 40 > /tmp/ps.txt ss -tunaep > /tmp/sockets.txt journalctl --since "1 hour ago" --no-pager > /tmp/journal_last_hour.txt > **Important:** capture timestamps in UTC and attach them to every artifact. Every hash, file transfer, and command must be logged for defensibility. ## Containment that preserves evidence and operations Containment is surgical, not binary. Modern EDRs give you three useful levers: **isolate the host** , **quarantine a file/process** , and **apply selective network exceptions**. Use the lightest control that prevents attacker objectives while preserving your ability to collect evidence and perform remediation. * Use selective isolation when critical services or remote remediation channels must remain open; use full isolation when lateral movement or exfiltration is confirmed. * When possible, prefer EDR `isolate` actions (they change network rules at the agent) over blunt network switches or physical unplugging, because EDR isolation preserves agent telemetry and remote management channels. Microsoft Defender for Endpoint documents the `isolate machine` API with `IsolationType` values (`Full`, `Selective`, `UnManagedDevice`) and shows how the console/API restricts network traffic while permitting agent/cloud communication. (learn.microsoft.com) * Record containment scope: which IPs, which processes, and which exclusion rules were applied. This becomes part of your chain-of-custody. Example selective isolation API (illustrative JSON from msdocs style; replace token/IDs with your environment values): POST https://api.securitycenter.microsoft.com/api/machines/{id}/isolate Authorization: Bearer {token} Content-Type: application/json { "Comment": "Isolate for suspicious PowerShell behavior - Alert 1234", "IsolationType": "Selective" } EDR vendor notes: * Use CrowdStrike or SentinelOne automation for containment when you need to scale actions across many hosts; both platforms expose APIs and RTR capabilities to script containment and remediation tasks. (crowdstrike.com) ## Forensic evidence collection: live capture and persistent artifacts Follow the _order of volatility_ — collect the most ephemeral evidence first. RFC 3227’s order is the canonical reference: registers/cache → routing/ARP/process table/kernel stats/memory → temporary files → disk → remote logs → archival media. Respect this ordering to maximize recoverable evidence. (rfc-editor.org) High-value artifacts to collect immediately (live): * **Memory image** (RAM) * **Process list + full process tree** * **Open network sockets and established connections** * **Active user sessions and authentication tokens** * **Volatile OS artifacts** : running services, loaded drivers, kernel modules * **Event logs (system, security, application, sysmon)** Persistent artifacts (next step): * Disk image / volume-level snapshot (if needed) * Registry hives (`SYSTEM`, `SAM`, `SECURITY`, user `NTUSER.DAT`) * Relevant log files and application data * Backups, cloud logs, mail server logs, proxy logs Example Windows live-collection commands (do these from a _trusted_ responder environment or via EDR staging; avoid running unknown binaries on suspect host): # Save registry hives reg save HKLM\SYSTEM C:\Temp\system.hiv reg save HKLM\SAM C:\Temp\SAM.hiv reg save HKLM\SECURITY C:\Temp\SECURITY.hiv # Export event logs wevtutil epl System C:\Temp\System.evtx wevtutil epl Security C:\Temp\Security.evtx # Simple file hashing certutil -hashfile C:\Temp\System.evtx SHA256 Example Linux live-collection (shrink output sizes; transfer to secure collector): # Net connections and processes ss -tunaep > /tmp/sockets.txt ps auxww > /tmp/ps.txt # Acquire memory (see tool section) sudo avml --compress /tmp/mem.lime sha256sum /tmp/mem.lime > /tmp/mem.lime.sha256 * Preserve copies: create at least two copies of critical evidence (one for analysis, one archived). Use `sha256` to verify every transfer. Tool notes and references: NIST’s forensics guidance integrates forensic techniques into incident handling and covers the distinction between operational and legal evidence collection. Use those practices as your policy baseline. (csrc.nist.gov) ## Memory analysis to reveal in-memory implants and secrets Memory captures are often the only place you find in-memory loaders, decrypted credentials, shellcode, injected DLLs, or ephemeral network tooling. Capture memory before you reboot or hibernate a host. Tools differ by platform: * Linux: **AVML** (a Microsoft-supported cross-distro memory acquisition tool that writes LiME-compatible images) is portable and supports upload to cloud storage. Use `avml --compress /path/to/out.lime`. (github.com) * Linux (kernel/embedded/Android): **LiME** remains the standard LKM for raw captures and supports streaming acquisition. (github.com) * Windows: **WinPmem** (Pmem suite) and **DumpIt/Magnet Ram Capture** are widely used and integrate with forensic suites. (winpmem.velocidex.com) * macOS: **OSXPMem** (MacPmem family) has special requirements (kexts, SIP considerations); pre-check macOS version and security policies before attempting live capture. (github.com) Use Volatility 3 for analysis — it’s the current standard with active support and parity for modern OSes. Typical Volatility 3 commands (after placing symbol packs where required): # Basic discovery vol -f memory.raw windows.info # Common analysis plugins vol -f memory.raw windows.pslist vol -f memory.raw windows.malfind vol -f memory.raw windows.dlllist vol -f memory.raw windows.cmdline Tool comparison (quick reference) Tool | Platform(s) | Output format | Footprint / Notes ---|---|---|--- `avml` | Linux (x86_64) | LiME `.lime` (compressed supported) | Small static binary, uploads to cloud; fails if `kernel_lockdown` is enforced. (github.com) `LiME` | Linux/Android | `.lime` / raw | LKM; good for Android, requires kernel module load. (github.com) `WinPmem` | Windows | raw `.raw` | Multiple acquisition modes; driver required in some modes. (winpmem.velocidex.com) `DumpIt` / `Magnet RAM Capture` | Windows | raw / crash dump | Widely used in law enforcement workflows; integrates with Magnet RESPONSE. (magnetforensics.com) `osxpmem` | macOS | raw | Requires kexts and elevated privileges; test on platform before operational use. (github.com) > **Analysis principle:** prefer tools that produce a verifiable hash and standardized format (LiME/RAW/aff4) so analysis frameworks like Volatility can parse symbol tables and plugins reliably. (volatility3.readthedocs.io) ## Practical playbook: checklists, commands, and runbook templates This section contains the ready-to-use checklists and runbook fragments you can adopt into an incident runbook. Use them verbatim as a starting point and adapt to your change windows and asset criticality. Triage & containment timeline (rapid runbook) 1. First 0–10 minutes — confirm & stabilize * Pull EDR alert and full detection JSON; record alert ID/timestamp/operator. * Snapshot process tree, network connections, and active sessions. * Decide containment posture (selective isolation vs full isolation). * Mark asset with an incident tag and owner contact. 2. Minutes 10–30 — evidence preservation * If isolation is applied, confirm it via EDR API and log the action. (learn.microsoft.com) * Acquire memory image (priority 1). * Collect volatile artifacts: process lists, sockets, loaded modules, event logs. * Generate SHA256 of each collected artifact and upload to secured evidence store. 3. 30–90 minutes — analysis and early remediation * Run automated memory analysis jobs (Volatility plugins) on a dedicated analysis host. * If attacker tooling is confirmed, rotate credentials for compromised accounts and block IOCs in perimeter devices. * If ransomware or destructive malware is present, escalate to executive communications and legal. 4. 1–3 days — eradication & restoration * Wipe and rebuild compromised asset images from known-good gold images (or apply validated remediation if allowed by policy). * Restore from vetted backups and validate via integrity checks. * Track MTTR and documented actions for metrics. Rapid triage script snippets PowerShell one-liner (local run to collect immediate artifacts): $Out=C:\Temp\IR_$(Get-Date -Format s); New-Item -Path $Out -ItemType Directory -Force Get-Process | Select Id,ProcessName,Path,StartTime | Export-Csv $Out\procs.csv -NoTypeInformation netstat -ano | Out-File $Out\netstat.txt wevtutil epl System $Out\System.evtx wevtutil epl Security $Out\Security.evtx Get-ChildItem HKLM:\SYSTEM -Recurse | Out-File $Out\registry_snapshot.txt Get-FileHash $Out\System.evtx -Algorithm SHA256 | Out-File $Out\hashes.txt Linux quick collector (bash): OUT=/tmp/ir_$(date -u +%Y%m%dT%H%M%SZ); mkdir -p $OUT ps auxww > $OUT/ps.txt ss -tunaep > $OUT/sockets.txt journalctl --since "1 hour ago" --no-pager > $OUT/journal_recent.txt sha256sum $OUT/* > $OUT/hashes.sha256 Chain-of-custody (table template) Item ID | Artifact | Collected by | Date (UTC) | Location (path / URL) | Hash (SHA256) | Notes ---|---|---|---|---|---|--- 1 | memory.raw | A.Responder | 2025-12-16T14:22:00Z | s3://evid-bucket/inc123/memory.raw | abc123... | compressed with avml 2 | System.evtx | A.Responder | 2025-12-16T14:25:00Z | s3://evid-bucket/inc123/System.evtx | def456... | captured before reboot Root cause and remediation (practical approach) * Root cause analysis focuses on the timeline reconstructed from memory, process trees, and network telemetry. * Identify initial access vector (phishing, RDP, orphaned service account) and remediation priority: credential rotation, patching vulnerable service, disabling abused accounts, and removing persistence mechanisms. * For remediation on endpoints, prefer agent-led surgical removal (EDR remediation scripts, file quarantine, process rollback) if the EDR provides application-aware rollback functionality. Restoration, reporting, and lessons learned * Restore only from _known-good_ images validated by checksums and test boots. * Create an incident report that includes: timeline, IOC list, containment actions, artifacts collected, legal/regulatory impacts, and MTTR metrics. * Conduct a post-incident review with stakeholders within 7–14 days and update playbooks and detection rules based on the IOCs and TTPs discovered. > **Operational metric to track:** time-to-first-containment, time-to-memory-capture, and time-to-remediation. Drive these numbers down with tabletop exercises and warm caches of forensic tooling. **Sources:** Computer Security Incident Handling Guide (NIST SP 800-61 Rev. 2) - Incident handling phases and recommended incident response lifecycle used as the backbone for triage and escalation. (nist.gov) Guide to Integrating Forensic Techniques into Incident Response (NIST SP 800-86) - Guidance on integrating forensic collection with IR and how to plan forensic-capable response. (csrc.nist.gov) RFC 3227: Guidelines for Evidence Collection and Archiving - Order of volatility and chain-of-custody principles referenced for live vs persistent evidence collection. (rfc-editor.org) Isolate machine API - Microsoft Defender for Endpoint (documentation) - API parameters and operational notes for selective/full isolation via Defender for Endpoint. (learn.microsoft.com) microsoft/avml (GitHub) - AVML tool documentation and usage examples for Linux volatile memory acquisition. (github.com) 504ensicsLabs/LiME (GitHub) - LiME loader for Linux/Android memory acquisition and formats. (github.com) Volatility 3 documentation (readthedocs) - Volatility 3 commands, plugins, and symbol handling for memory analysis. (volatility3.readthedocs.io) WinPmem documentation (WinPmem site) - WinPmem acquisition modes and guidance for Windows memory imaging. (winpmem.velocidex.com) Magnet Forensics: Free tools & Magnet RESPONSE (DumpIt, Magnet RAM Capture) - Magnet RESPONSE and RAM capture tooling and workflows for remote collection. (magnetforensics.com) CrowdStrike: How automated remediation extends response capabilities (blog/documentation) - Background on EDR-enabled surgical response and Real Time Response execution patterns. (crowdstrike.com) Treat the endpoint like a fragile crime scene: collect volatile artifacts first, isolate surgically, analyze in a controlled environment, and rebuild from validated images — the minutes and checksums you record in the first hour determine whether you recover cleanly or litigate defensibly.
dev.to
October 17, 2026 at 8:14 AM
"Scaling Actors and Workers With HPA In Agent Substrate" by Michael Levan

www.cloudnativedeepdive.com/scaling-acto...
Scaling Actors and Workers With HPA In Agent Substrate
How do you autoscale Agent Substrate workers? This guide covers configuring HPA, choosing scaling metrics, and scaling actors on Kubernetes.
www.cloudnativedeepdive.com
October 15, 2026 at 12:02 PM
📦 cboxdk/laravel-queue-autoscale v4.4.1

Intelligent, predictive autoscaling for Laravel queues with SLA/SLO-based optimization

🔗 https://github.com/cboxdk/laravel-queue-autoscale
October 14, 2026 at 8:21 PM
Scalable Video Streaming Architecture: Micro‑services vs Monolith
## Quick Answer Learn how to build a production‑grade, scalable video streaming architecture using microservices, CDNs, and analytics—optimized for latency, cost, and reliability. ## Single CDN Push Fails During Viewer Surge When a 200k‑viewer spike hits a live concert stream, the naive “push to a single CDN and call it a day” approach collapses under a cocktail of bandwidth bursts, cache misses, and a single monolith that can’t autoscale. In the wild, this manifests as 3‑second latency spikes, 30‑second re‑buffer bursts, and a 15 % spike in egress costs that the finance team didn’t budget for. ## Real‑world Example Last year a music‑festival operator ran a live event from a single Azure region. They had a monolith that ingested RTMP, ran FFmpeg, and served HLS from a shared Blob container. During the peak 8‑minute set, the ingestion queue filled to 200 k messages, the FFmpeg process stalled, and the CDN reported a 60 % cache‑miss rate. The result: **25 % of viewers saw >5 s of re‑buffering and 18 % abandoned the stream within the first minute.** ## Trade‑offs * **Monolith vs. Micro‑services** : A single process is easier to ship but forces you to scale everything together. Splitting the pipeline into stateless services lets you autoscale the transcoder independently, but you pay for the operational overhead of a message bus and service discovery. * **Live vs. Batch Ingest** : A low‑latency RTMP‑to‑HLS path requires in‑memory packet buffers and a tight end‑to‑end pipeline, but it exposes you to jitter in the upstream source. A batch ingest pipeline can tolerate upstream hiccups but introduces a 30‑second delay that kills live‑event UX. * **CDN Caching Strategy** : Caching every rendition at every edge node maximizes hit rates but inflates storage costs and can lead to stale DRM‑protected content. A tiered cache that only stores the most popular bitrates reduces egress but requires a more sophisticated cache‑invalidation logic. * **Spot vs. On‑Demand Transcoding Workers** : Spot VMs cut transcoding costs by 60 % but can be reclaimed at any time, forcing you to keep a fallback on‑demand pool or risk dropping segments. On‑demand VMs offer stability at 2× cost. * **Stateless vs. Stateful Queues** : Kafka gives you ordering guarantees and replayability but adds a 12 h retention cost. Azure Service Bus offers simpler APIs but lacks the same throughput for high‑volume live events. ## Latency KPIs, Queue Choice & Transcoder Scaling 1. **Define the Latency KPI** – If _sub‑second_ latency is a product requirement, go for a dedicated RTMP ingestion service with a single‑partition Kafka topic per channel and keep the transcoder warm. 2. **Choose the Queue** – For >100k concurrent viewers, Kafka’s high throughput and partitioning is a must. Use idempotent producers and sequence numbers to guard against re‑balance induced ordering loss. 3. **Transcoder Scaling** – Deploy a warm pool of 3 FFmpeg pods per channel. Use an HPA that scales on `queue_length` and set a `maxReplicas` that respects your spot‑VM quota. 4. **CDN Tiering** – Cache 720p/1080p at Tier‑1 POPs, 4K at Tier‑2 regional caches, and pull the rest from origin. Use short‑lived signed URLs (30 s) and push a CDN purge on DRM revocation. 5. **Compliance** – Run ingestion in the country of origin, store raw chunks locally, and replicate only encrypted HLS fragments to global edges. Use Azure Private Link to keep traffic inside the VNet. 6. **Observability** – Emit OpenTelemetry metrics for `buffer_health` and `rebuffer_seconds`. Trigger autoscaling or alerts when `rebuffer_seconds` > 2 s for >10 % of sessions. 7. **Cost Optimisation** – Run a cost simulation: 60 % spot + 40 % on‑demand transcoding yields a 35 % reduction in egress while keeping 95 % uptime. ## When This Fails in Production * **Kafka Partition Rebalance During Live** – A rebalance can drop the ordering of chunks, causing playback gaps. Fix: use a single partition per channel or enable idempotent producers with sequence numbers. * **DRM Token Cache Stampede** – 10k simultaneous token refreshes can overwhelm the license server. Fix: local in‑memory cache with a 5 s TTL and a leaky bucket limiter on the license endpoint. * **Cold‑Start Transcoder Latency** – FFmpeg containers take 8 s to start, dropping the first few seconds of a live stream. Fix: maintain a pool of 2–3 warm transcoder pods and a readiness probe that waits for the first FFmpeg binary load. * **Edge Cache Invalidation Lag** – A revoked token may still be served from a stale cache for up to 5 min. Fix: push a CDN purge immediately on token revocation and use a short signed URL TTL. * **Unbounded Queue Growth** – If the ingestion rate spikes faster than transcoding can keep up, the raw‑chunks queue grows unbounded. Fix: back‑pressure the ingestion service by exposing a queue depth metric and throttling incoming RTMP packets. ## Common Mistakes Engineers Make * Assuming the CDN will automatically handle DRM‑protected content; many CDNs cache the license URL as a static asset. * Using a shared Blob container for both raw and transcoded assets; this causes contention and unpredictable IOPS. * Relying on CPU metrics for HPA; transcoding is I/O bound, so queue depth is a better metric. * Neglecting to purge the CDN on DRM revocation; stale keys can expose content for hours. * Over‑optimising for cost by running all transcoding on spot VMs without a fallback; this leads to dropped segments during spot evictions. ## Better Approach Based on Experience In a production environment, I would: * **Use a dedicated RTMP ingestion service per region** with a single‑partition Kafka topic to guarantee ordering and minimal latency. * **Implement a warm pool of FFmpeg containers** that are kept alive in a ready state and only spun up when the queue depth exceeds 200. * **Adopt a multi‑tier CDN strategy** , caching only the most popular bitrates at the edge and using origin shields to reduce duplicate pulls. * **Leverage Azure Private Link and Azure Front Door** for secure, low‑latency routing to the CDN while keeping all traffic within the VNet. * **Instrument everything with OpenTelemetry** and set up automated alerts for >5 % rebuffer spikes, which trigger an autoscaling rule that adds transcoder pods in the affected region. * **Run a cost‑simulation before launch** that mixes spot and on‑demand instances, validates the CDN purge latency, and ensures the DRM license server can handle a 5 k requests/second burst. Architecture Option | Latency Impact | Cost Impact | Reliability Impact ---|---|---|--- Microservices + CDN + Real‑time Analytics | Low—edge caching + immediate data processing reduces buffering | Higher—multiple services and real‑time data pipelines | High—service isolation, auto‑scaling, real‑time failover Microservices + CDN + Batch Analytics | Low—edge caching same as above | Moderate—batch jobs less frequent than real‑time | High—service isolation, auto‑scaling, but delayed anomaly detection Monolithic + CDN | Medium—single deployment, may not scale to edge nodes quickly | Low—fewer services, simpler ops | Medium—single point of failure, harder to isolate faults ### Performance Considerations * Use `ffmpeg -threads 8` and `-preset veryfast` to balance CPU usage and encoding speed. * Store raw chunks in Azure Blob Storage with the `Hot` tier and set the `Cache-Control: immutable` header for subtitles to push them into edge TTLs forever. * Set the CDN `minTTL` to 30 s for HLS segments; this prevents the CDN from fetching the same segment from origin for each request. * Enable `origin shield` on the regional node to avoid duplicate pulls from storage during a flash surge. * Use a `maxReplicas` of 30 for transcoder HPA to handle a 200k viewer spike, but cap the total CPU usage at 80 % to avoid thrashing. ### Scaling Notes * Scale the ingestion service horizontally by adding more RTMP listeners; each listener writes to a dedicated Kafka partition. * Use a `queue_length` metric that aggregates across all partitions to decide when to spin up transcoder pods. * For global events, deploy the CDN edge nodes in all major regions and keep the transcoder pool region‑specific; this avoids cross‑region data transfer costs. * Implement a `back‑pressure` signal from the transcoder to the ingestion service when the queue depth > 5000, causing the ingestion service to drop non‑essential metadata packets. ### Migration Checklist 1. Catalog all API endpoints and map them to the four target services. 2. Containerize each service and externalise all configuration via Kubernetes secrets. 3. Deploy a staging cluster with HPA enabled; run a 5 % traffic shadow test. 4. Introduce Kafka topics incrementally – start with `raw‑chunks` only, keep the legacy pull‑based transcoder as a fallback. 5. Enable CDN edge caching for a single region; validate cache‑hit ratios before expanding globally. 6. Instrument every service with OpenTelemetry; set up alerts on >5 % increase in rebuffer rate. 7. Run a cost‑simulation (Azure Pricing Calculator) for spot‑vs‑on‑demand transcoder mix. 8. Cutover live traffic during a low‑viewership window; keep the monolith on standby for 48 hours. ### Conclusion Scalable video streaming is not a set of optional knobs but a disciplined architecture where latency, cost, and compliance are baked into every layer. Treat sub‑second latency as a product KPI, not a after‑thought, and you’ll halve churn for live‑event platforms and unlock premium pricing tiers. ### Related Articles * Designing a Distributed Task Queue Architecture for Code Execution at Scale * Cutting Inference Costs: kv-cache and batching for inference serving in .NET * Observability for LLM Apps in ASP.NET Core: Trace First, Metrics * AI Orchestration for Enterprise .NET Applications: Scaling Intelligent Agents with Azure * Self-Attention vs. Cross-Attention in .NET RAG: Architectural Trade‑offs You Must Know
dev.to
September 30, 2026 at 3:52 AM
InstaCloud provides the serverless compute that lets your services autoscale, with all the infrastructure managed for you.

Agents branch into complete replica environments when working, keeping prod safe and iteration speed high.
September 29, 2026 at 3:53 PM
Nick Roan's team changed RAG chunking from 512 tokens to 500. Tests passed, answers stayed accurate.

vLLM prefix cache hit rate: ~85% to ~4%. GPU replicas: +80% on the same traffic. p95 latency never left its SLO. 🧵

podostack.com/p/autoscale...
The autoscaler that hid a prefix cache collapse: 80% more GPUs
vLLM chained block hashes, RAG chunk boundaries, latency-driven scale-out, token-weighted hit rate, prefix-aware routing
podostack.com
September 25, 2026 at 2:34 PM
More replicas can make it worse: the cache is per pod, so a cache-blind Service makes every pod prefill each hot prefix once. llm-d's prefix-aware routing covers that half.

Links:
- docs.vllm.ai/en/latest/d...
- llm-d.ai

podostack.com/p/autoscale... 🍇
The autoscaler that hid a prefix cache collapse: 80% more GPUs
vLLM chained block hashes, RAG chunk boundaries, latency-driven scale-out, token-weighted hit rate, prefix-aware routing
podostack.com
September 25, 2026 at 2:34 PM
📦 cboxdk/laravel-queue-autoscale v4.3.3

Intelligent, predictive autoscaling for Laravel queues with SLA/SLO-based optimization

🔗 https://github.com/cboxdk/laravel-queue-autoscale
September 24, 2026 at 1:59 PM
‘Not my cup of tea’ is the most expensive sentence in your engineering org
I run interviews every week. Around minute 25, I ask about customer-facing experience. Have you sat in front of the people who use what you build? The answer I get most often: “That’s not really my cup of tea.” A few minutes later, I ask a Python engineer which metrics he’d use to autoscale the service he just described. “That’s more of a DevOps question.” Two answers. Same excuse. There’s a border, and the candidate has decided everything on the other side belongs to someone else. Before tech, I captained a warship. 20 people, 30 months at sea. Out there, you master skills that have nothing to do with your specialty, because a ship where everyone stays in his lane and nobody talks to the next station is a ship that sinks. “Not my cup of tea” doesn’t exist at sea. So, when I hear the border excuse in an interview, I don’t hear a preference. I hear a ceiling the candidate built himself. ## The market flipped, and the candidates didn’t LinkedIn’s Most In-Demand Skills report put communication at number one for 2024, second year running, above every hard skill on the list. Its Skills on the Rise report for 2026, built from a billion member profiles, puts AI literacy at the top of the technical side, while soft skills take seven of the top ten spots overall, including conflict mitigation and public speaking. None of this is new, either. Harvard economist David Deming showed it back in 2017: between 1980 and 2012, the jobs that run on human interaction expanded their slice of the American workforce by 12 points. The loner jobs built on pure math, plenty of STEM in there, lost ground. AI didn’t start the fire. It poured fuel on it. Meanwhile, the skill we spent 20 years paying a premium for is getting commoditized in real time. Developers themselves put the figure at 42% of their committed code now being written or assisted by AI, up from 6% in 2023, per Sonar’s State of Code survey. At Cloudflare, 97% of the engineering org now codes with AI tools, and every production code contribution gets reviewed by autonomous AI agents. That came from their Q1 2026 earnings call, not a keynote. Companies can hype a keynote. They get sued over an earnings call. A large slice of what a mid-level engineer did in 2019 is now a prompt and a review. I don’t need to convince a CIO of that in 2026. The invoices already did. ## The typing got cheap. The judgment didn’t. To be clear, nobody commoditized deep technical understanding. What got cheap is the typing. And the moment typing got cheap, judgment got expensive. Somebody still has to decide what deserves to be built, what gets skipped and which team burns its budget on which problem. A model spits out options all day long. It won’t pick one for you. That call needs a human who understands the whole board, and those humans are exactly what the silo never produces. Which is why that ceiling from the interview room is so loud. An engineer who caps his own understanding in 2026 is announcing he hasn’t understood what’s happening around him. Code got cheap. Talking got expensive. Nobody repriced their career. So, what’s rare now? The engineer who can walk a VP of Sales through a tradeoff without once mentioning the stack. The one who can take an angry customer’s call, all 40 minutes of it, and stay curious instead of defensive. Every year my interviews surface fewer people who can pull off either one. No study backs this. My notes do. ## How we got here Covid killed the hallway and we buried it with a hybrid policy. The arguments at the whiteboard, the “got a sec?” over someone’s shoulder, they all migrated into Slack. Problem is, nobody can grab your shoulder in Slack. You can go dark for a whole day, and the tool calls it focus. Then the productivity religion redefined talking as a waste. I’ve read the books; some of it is right. But a whole generation absorbed the gist without the nuance, and the gist is: every human interaction is an interruption. A customer call is somebody else’s job. We made it worse ourselves. Twenty years of interview loops built around algorithm puzzles selected, at scale, for people who perform best alone with a screen. Then we act surprised they’d rather be alone with a screen. And we split teams by tool instead of by problem. Python people here, Kubernetes people there and when a request landed on the seam, we invented a word for the seam. DevOps was supposed to be a culture. It became a tag you put on a ticket, so it stops being yours. And at some point, the teams inside the building started acting like strangers doing business. The team next door stopped being colleagues and became “a service we consume.” You file a ticket, you wait for the SLA, you never hear a human voice. With an outside provider, fine, that’s the deal. Inside one company, on one platform? That’s two crews on the same ship passing notes under the door. Somewhere along the line we decided a 10-minute conversation costs more than a three-day ticket loop. That’s on us. On CIOs, on CTOs, on CEOs, on me. ## The perfect colleague Then AI showed up as the perfect colleague. Never interrupts. Never needs the context twice. Never has an opinion you didn’t ask for. Never makes you feel stupid for asking. Available at 2 AM, and I have tested that more times than I should admit. And it’s addictive in a way nothing in this job has been before. You open the IDE, you describe, the thing appears, you push, you describe the next thing. Hours go by. Nobody interrupted you, and nobody disagreed with you. Feels like the most productive day of your career. Some days it is. I feel the pull myself, and I have been managing people for more than 22 years. Thing is, it compounds. Communication is a muscle, and the reps used to come for free: the standup, the design argument, the customer who called because the ticket wasn’t clear, the product manager who wanted it explained again. Every one of those reps now has a substitute that doesn’t talk back. Reps drop to zero. Muscle goes. The next customer call feels harder than the last one, so you avoid it a bit more, so the muscle goes faster. Nobody decides to get worse at talking to people. It happens one quiet, very productive day at a time. Twelve months of that and a senior engineer who used to run design reviews can’t hold a room. He won’t notice. His manager will. ## So, we need generalists now? Wrong conclusion, and I hear it from CIOs weekly. We don’t need generalists. We need people willing to level up. To combine pieces, they never had to combine, because for 20 years the org chart did it for them. The barrier has never been lower. It used to take a course and a colleague with spare time. Now it takes a model and the willingness to ask. The excuse is gone. Does that make you less of a specialist? Of course not. It makes you a better one, because the silo was constraining your understanding, and you couldn’t see it from inside. The autoscaling question. Which metrics actually drive scaling for the service you wrote, and why those? People park it one desk over. A software engineer should own it, because every answer depends on the code he wrote. A senior should have known before I asked. AI made breadth cheap. The specialist’s excuse died. The specialist didn’t. The ones who ignore all this won’t get fired. Nothing that dramatic. Their work will simply dry up around them. The product manager who used to bring them questions now asks the model instead. Fewer requests land on their desk. Their salary stops moving. Then one day they test the market, search for “Python developer” openings, and find the titles changed while they weren’t looking. Firms now ask for web engineers, people who own the whole picture, front to back. Nobody sent a memo. The market repriced the role quietly, while they kept their head down in their lane. ## The customer border Not long ago I had a problem with a flight and spent days trying to reach my airline. Every path led to a bot. No phone number for a human anywhere, and my case was the one in a million the flows were never built for. I ended up driving to the airport to talk to a person at a desk. Think about that. I build conversational AI for a living and even I couldn’t find the human. The bots handled the million. The airport desk handled me. Years around customer experience taught me to admit this out loud: there are moments a customer needs a person. When the system is down at 11 PM and the quarter closes tomorrow, nobody wants a knowledge base. They want a human who owns the problem and says so. You can’t prompt your way through an angry customer. And you can’t force people to stop feeling human when things go wrong. Sentimental beings, all of us. That need is not going anywhere. I know exactly where the bot stops and the human starts, because that handoff is the product I build. The engineer who never sat in the escalation queue designs that moment from a spec sheet. The one who sat there writes different code. Different priorities. Fewer features nobody asked for. The bot gives you the answer. The customer gives you the problem you didn’t know you had. Only the second one compounds into judgment. ## Customer-facing is not sales Part of the resistance, and I see this in interviews constantly, is a misunderstanding. Engineers hear “customer facing” and think sales. They picture memorizing everything, defending the firm with skills they don’t have, performing some salesy theater. Wrong on every count. Customers reward honesty. They respect the engineer who says, “I don’t know, let me check” and actually comes back. And customers idolize the tech people who visibly care about their problem, because that is rare. I watched it happen recently. In a QBR, the quarterly review we run with customers, one of them asked for a technical representative in every meeting going forward, next to the project side. I added an architect to the rotation. The customer loved it. The architect gained more. He was doing this work already, just never in front of the people paying for it. Now he had to structure his thinking, prepare and answer live questions with no editor between him and the room. He leveled up within a quarter. The runbooks existed before. The documentation existed. What changed was one man willing to step out of his comfort zone and take pride in his work in front of the people who use it. So, should engineers run customer sessions? The willing ones. And here I’ll argue with an earlier version of myself, because I used to think you assign this like a watch bill, the duty roster of a ship. You can assign exposure. You can’t assign mastery. On my ship, the officers who grew into command were never the ones I had to push toward the bridge. They were the ones already up there off duty, asking about the next qualification. Same in engineering. Introvert is a personality. Unwilling is a decision. ## Four moves, starting Monday Change the interview loop. Add one round where the candidate explains his system to someone outside tech and gets interrupted with naive questions. Then ask him something one desk over from his specialty. Watch the reaction. The reaction is what you’re hiring. Coach the ones who raise their hand. Some engineers struggle in front of customers, know it and want to fix it. Give them real budget: training, shadowing, a debrief after every session. Film review, like athletes do. Nothing you fund this year will return more. Stop persuading the rest. If someone needs a campaign to see why this matters, he will never put in the work the skill demands. Nobody masters a craft he was talked into. Spend that energy on the willing. Organize by problem, not by tool. If a customer request always needs two teams and a handoff, fix the org chart, not the request. And kill the internal vendor act. One platform, one crew. ## The part nobody wants to hear Communication was never a soft skill. We just called it that while code was the expensive thing. Code isn’t expensive or scarce anymore. What’s left is the muscle we let atrophy and the border we let people hide behind. AI can accelerate everything except experience. Sitting with a human who’s frustrated with your product still takes reps. Find the ones who want the reps. Bet on them.
www.cio.com
September 24, 2026 at 4:06 AM
How close is your subscription to its regional vCPU quota? Running near the cap breaks nothing, until a deploy, autoscale, or DR failover fails with QuotaExceeded. Raising the limit takes hours to days.

Learn more at getstratolens.com
September 12, 2026 at 4:00 PM
SLA-Based Queue Autoscaling for Laravel
SLA-Based Queue Autoscaling for Laravel
Intelligent, predictive autoscaling for Laravel queues with SLA/SLO-based optimization - cboxdk/laravel-queue-autoscale
laravel-news.com
September 11, 2026 at 5:00 PM
Multi-stage Docker builds: ship the artifact, not the build shop
Most Node images I inherit are somewhere north of a gigabyte. The app inside is maybe 40 MB. The other gigabyte is the build shop: compilers, dev dependencies, the npm cache, a full copy of the source, and whatever the base image shipped with. That gigabyte costs you every day. Slower pulls on every deploy and every autoscale event. More layers for your scanner to chew through. A bigger surface for a CVE to land on. And a longer gap between "push" and "running in production". Multi-stage builds fix this without touching your application code. Here is how they work and how to get the details right. ## What ends up in a single stage image When you write a normal Dockerfile, every instruction adds a layer, and every layer stays in the final image. A typical Node build looks like this: FROM node:20 WORKDIR /app COPY package*.json ./ RUN npm ci COPY . . RUN npm run build CMD ["node", "dist/server.js"] The final image now contains: * `node:20`, which is Debian plus the full Node toolchain, around 1.1 GB before you add anything * every dependency, including the dev ones you only need to compile * the npm cache left behind by `npm ci` * your entire source tree, not just the compiled output * any build artifacts you generated on the way You run `node dist/server.js`. Everything else is dead weight that ships anyway. ## The multi-stage pattern A multi-stage Dockerfile has more than one `FROM`. Each `FROM` starts a new stage with its own filesystem. You do the messy work in an early stage, then start a clean final stage and copy in only what you need with `COPY --from`. FROM node:20 AS build WORKDIR /app COPY package*.json ./ RUN npm ci COPY . . RUN npm run build FROM node:20-slim WORKDIR /app COPY package*.json ./ RUN npm ci --omit=dev COPY --from=build /app/dist ./dist CMD ["node", "dist/server.js"] Two things changed: 1. The first stage is named `build` with `AS build`. It installs everything and compiles. None of its layers reach the final image. 2. The second stage starts from `node:20-slim`, a much smaller base. It installs production dependencies only, then copies the compiled `dist` folder out of the `build` stage. The compilers, the dev dependencies, and the source tree never make it into the image you ship. Same build, a fraction of the size. ## Get these four details right ### Name your stages Use `AS <name>` on stages you copy from, then reference them in `COPY --from=<name>`. You can also copy from an external image directly, for example `COPY --from=nginx:latest /etc/nginx/nginx.conf ./`, which is handy for grabbing a single binary or config file. ### Do not copy node_modules across stages It is tempting to `COPY --from=build /app/node_modules ./node_modules` and skip a second install. Do not. The build stage has dev dependencies mixed in, and native modules may have compiled against a different base image. Run `npm ci --omit=dev` in the final stage so you get a clean production tree that matches the runtime. ### Order instructions so the cache survives Docker caches each layer and reuses it until something upstream changes. Copy your lockfiles and install before you copy the rest of the source: COPY package*.json ./ RUN npm ci COPY . . Now a change to your application code invalidates only the `COPY . .` layer and everything after it. The dependency install, which is the slow part, stays cached. Reverse those lines and every one line code change reinstalls everything. ### Go smaller on the final base `node:20-slim` drops most of the Debian extras. For a bigger cut, `gcr.io/distroless/nodejs20` ships Node and nothing else, no shell, no package manager. It is stricter to debug but the attack surface is tiny. Whatever you pick, add a non-root user: FROM node:20-slim WORKDIR /app COPY package*.json ./ RUN npm ci --omit=dev COPY --from=build /app/dist ./dist USER node CMD ["node", "dist/server.js"] ## The same feature, other uses Multi-stage is not only about size. **One Dockerfile, several targets.** Add a `test` stage and build just that stage in CI with `docker build --target test .`. Your test image and your production image come from the same file and the same base layers. FROM node:20 AS build # ... install and compile ... FROM build AS test RUN npm run lint && npm test FROM node:20-slim AS production # ... copy artifact ... **Pulling a tool without installing it.** Need `dockerize` or a specific CLI at runtime? Copy the single binary from its published image in a stage instead of running a package manager in your final image. ## What this looks like in numbers On a plain Express and TypeScript service: * Single stage on `node:20`: about 1.1 GB * Multi-stage with `node:20-slim` and `--omit=dev`: about 180 MB * Multi-stage with distroless: about 130 MB Pull time on a cold node drops from tens of seconds to a few. Your scanner has less to report. And nothing in the image can compile code or run a shell that does not need to. ## Takeaway Build with the full toolchain in an early stage. Start the final stage from the smallest base you can debug, install production dependencies only, and copy in just the artifact. Name your stages, keep your install layer above your source copy, and run as a non-root user. It is a ten line change to your Dockerfile and it pays off on every deploy.
dev.to
September 10, 2026 at 7:28 PM