How to size RAM and CPU for a cloud website

How to size RAM and CPU for a cloud website

A practical way to estimate RAM and CPU needs from website traffic and workload characteristics.

1. Inputs needed before sizing

Visits per day alone are not enough. Estimate daily active users or traffic, the share arriving during peak hours, requests per user and response time.

  • Example daily traffic: 10,000 visits.
  • Peak traffic share: often 10–30% in the source estimate.
  • Requests per user: 5–20.
  • Response time: seconds required to process one request.

2. Calculate requests per second (RPS)

RPS = (total visits × requests per user × peak share) / (3600 × peak hours).

For 10,000 users per day, 10 requests per user and 20% of traffic during a two-hour peak: RPS = (10,000 × 10 × 0.2) / (3600 × 2), approximately 2.8 requests per second.

3. Estimate concurrent users

Concurrency = RPS × response time. With 2.8 RPS and a 0.5-second response, the example gives approximately 1–2 concurrent users.

4. Convert the estimate to CPU

The article uses a rough rule of 50–200 RPS per CPU core, depending on the application. Heavy Java, AI or database-query workloads are estimated at around 50 RPS per core; lighter Node.js or well-cached applications at around 100–200 RPS per core.

The example describes 2.8 RPS as requiring roughly 0.1 CPU core and recommends provisioning at least 1 vCPU in practice. These are planning estimates, not measured throughput guarantees.

5. Convert the estimate to RAM

RAM depends on memory per request and concurrency: RAM ≈ concurrent users × RAM per request + system RAM.

With two concurrent users and 50MB per request, request memory is about 100MB. Adding approximately 300–500MB for the OS and application leads to a starting range of approximately 512MB–1GB.

6. Quick planning table

Daily trafficPeak RPSCPURAM
1,000About 11 vCPU512MB–1GB
10,000About 3–51 vCPU1–2GB
100,000About 20–502–4 vCPU4–8GB
1,000,000About 200+8+ vCPU16GB+

7. Factors that change the result

  • Redis or CDN caching can reduce CPU demand.
  • Heavy database queries increase CPU and RAM requirements.
  • File uploads and downloads can increase RAM and bandwidth demand.
  • API-heavy usage increases request rates.
  • Server-side rendering, such as Next.js, can use more CPU than a SPA.

8. Short formulas

For a quick estimate, the article uses CPU ≈ RPS / 100 and RAM ≈ concurrency × 50MB + 500MB.

9. Practical starting points

The article suggests 1 vCPU and 1GB RAM for a small website, or 2 vCPU and 4GB RAM for a medium website. For growth, consider autoscaling, for example with Kubernetes.

For consultation, prepare daily traffic, application type such as WordPress, React or an API, and database technology such as MySQL or MongoDB. Contact: [email protected], 0354 312 551.

Published ; updated

Related pages