xiaohongshu
xiaohongshu
Methods for determining the optimal resource allocation for compute, database, and network systems to balance cost and performance.
Full skill instructions
Infrastructure sizing is the process of determining the exact amount of CPU, Memory, Storage, and Network capacity required for a workload. Effective sizing avoids both Over-provisioning (wasted money) and Under-provisioning (poor performance/outages).
Core Principle: "Sizing is not a one-time event; it is a continuous feedback loop based on real utilization metrics."
Traditional sizing used the "Peak + Buffer" model, leading to massive waste. Modern sizing uses Demand-Driven Allocation.
| Principle | Description |
|---|---|
| Utilization Thresholds | Target 40-70% CPU utilization. Below 40% is over-provisioned; above 80% is risky. |
| Vertical first... | Increase resource limits for single-threaded or monolithic apps. |
| ...Horizontal usually | Spread load across multiple small instances for resilience and elasticity. |
| Metric-Based | Use P95 or P99 metrics for latency, but Average for base capacity sizing. |
Run your app in a staging environment and measure:
| Family | Best For | AWS Example | GCP Example |
|---|---|---|---|
| General Purpose | Balanced workloads, small DBs | t3, m6g | n2, e2 |
| Compute Optimized | Batch processing, high-traffic APIs | c6g, c7i | c2, c3 |
| Memory Optimized | Redis, high-RAM DBs, Analytics | r6g, x2 | m1, m2 |
Target Instances = (Total Peak Concurrent Requests * Avg Service Time per Req) / (Target Utilization per Core * Core Count)
Disk performance is often the bottleneck, not CPU.
Required Storage = (Initial Data Size) + (Daily Ingest * Retention Period) * (1 + Overhead Buffer)
Max Connections = (Instance RAM / 10MB) - (System Reserve)
Caching is a trade-off between Memory Cost and Latency Benefits.
Not all data needs to be in cache. Only store the Working Set (frequently accessed data).
Understanding the difference between Requests and Limits is critical for both stability and cost.
| Metric | Purpose | Cost Impact |
|---|---|---|
| Requests | Kubernetes guarantees this capacity. Used for scheduling. | High: Cloud Providers charge based on requests. |
| Limits | The maximum a pod can burst to. | Low: Generally doesn't impact cost unless using serverless K8s. |
If Memory Requests < Actual Usage, the pod might be scheduled on a node that runs out of RAM, leading to an OOMKill (Out Of Memory).
Serverless "scaling" is handled by the provider, but "sizing" (Memory allocation) is handled by you.
AWS Lambda Power Tuning to find the "Sweet Spot" where performance and cost intersect.| Memory (MB) | Duration (ms) | Cost ($) | Result |
|---|---|---|---|
| 128 | 1000 | 0.0000021 | Slow |
| 512 | 200 | 0.0000016 | Winner (Faster & Cheaper) |
| 1024 | 150 | 0.0000025 | Diminishing returns |
Never size based on assumptions. Use tools like k6, Locust, or JMeter.
| Component | Metric | Current Load | Growth (6mo) | Buffer | Target Spec |
|---|---|---|---|---|---|
| Web Tier | Peak Req/sec | 500 | 2x (1000) | 20% | 4x c6g.large |
| Database | Storage | 500GB | +100GB/mo | 30% | 1.5TB GP3 |
| Cache | Working Set | 8GB | 12GB | 10% | 16GB Node |
m5.xlarge (4 vCPU, 16GB RAM). Monthly cost: $1,400.t3.large ($350/mo) + enabled Auto-scaling.40-system-resilience/graceful-degradation42-cost-engineering/cloud-cost-models42-cost-engineering/budget-guardrailsxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience