Sizes and resources
Deployed and supported. The fields and commands described here are stable within version v1alpha1.
A service sets neither CPU nor memory: it chooses a size, from xxxs to xxxl. The size
sets what is reserved for it; it can consume up to double at peak. The total of the
services of your tenant is bounded by your plan's quota.
Prerequisites
- Know your plan: Tiers.
Steps
1. Choose a size per service
apiVersion: deploy.stackngo.io/v1alpha1
kind: App
metadata:
name: shop
spec:
services:
api:
image: registry.gitlab.com/acme/shop-api:1.4.2
ports: ["8080"]
size: xs # 500m / 1Gi reserved
replicas: 2
worker:
image: registry.gitlab.com/acme/shop-worker:1.4.2
size: xxxs # 100m / 200Mi: perfect for a light task
db:
image: postgres:17
user: "999"
ports: ["5432"]
size: s # 1 CPU / 2Gi
volumes:
- { path: /var/lib/postgresql/data, size: 10Gi }
Without size, a service is xxs. On the command line: sng app create … --size s,
sng app patch shop --service api --size m.
2. Apply and read the state
sng apply shop.yml
sng app describe shop
If the plan is not enough:
App : shop
Statut : QuotaExceeded
Message : db : … exceeded quota … requested: limits.memory=4Gi, used: …, limited: …
SERVICE KIND IMAGE PHASE URL DETAIL
api deployment registry.gitlab.com/acme/shop-api:1.4.2 Ready - Reconciled 2/2 prêts
db deployment postgres:17 Failed - QuotaExceeded … exceeded quota …
worker deployment registry.gitlab.com/acme/shop-worker:1.4.2 Ready - Reconciled 1/1 prêts
Reduce the size or the number of replicas, or change plans, then sng apply.
Verification
sng app describe shop: Statut : prête. Each service has the reservation of its
size and can go up to double.
Sizes
size | Reserved CPU / memory | CPU / memory limit |
|---|---|---|
xxxs | 100m / 200Mi | 200m / 400Mi |
xxs (default) | 200m / 500Mi | 400m / 1000Mi |
xs | 500m / 1Gi | 1 / 2Gi |
s | 1 / 2Gi | 2 / 4Gi |
m | 1 / 5Gi | 2 / 10Gi |
l | 2 / 10Gi | 4 / 20Gi |
xl | 4 / 24Gi | 8 / 48Gi |
xxl | 10 / 48Gi | 20 / 96Gi |
xxxl | 20 / 64Gi | 40 / 128Gi |
1000m = 1 CPU. The reservation is guaranteed to the container; the limit is the ceiling
beyond which it is throttled (CPU) or stopped then restarted (memory). The limit is always
2 × the reservation, for CPU as for memory.
The same values apply to the service's initialization container (init).
Your plan's quota
Your tenant has a global quota, set by its tier: guaranteed CPU and memory (the sum of the reservations), max CPU and memory (the sum of the limits, that is double the reservations), storage and instances. Both ceilings count. Two things to remember:
- add up the reservations of your instances and compare them to the tier's guaranteed
values, then their double to the max: in
3XS(0.5 CPU / 1 Gi guaranteed, 1 CPU / 2 Gi max), twoxxsservices fit (400m / 1000Mi reserved, 800m / 2000Mi of limits), but not one morexxxs(1200Mi reserved); - the quota counts each instance:
replicas: 3inxsweighs 3 × (500m / 1Gi); during a rolling update, the extra instances (maxSurge) count too;autoscale.maxsets the worst case.
When a service exceeds the quota:
| When | Phase and reason | What you see |
|---|---|---|
| at service creation | Failed, QuotaExceeded | the message mentions exceeded quota and the resource at fault |
| during an update or a scale-up | Progressing, QuotaExceeded | the new instances do not start; the old ones keep serving |
Going from a compose consumption to a size
If your docker-compose.yml declares deploy.resources.reservations (or limits otherwise),
take the smallest size whose reservation covers both CPU and memory:
cpus: "0.25", memory: 256M → xs (xxs offers 200m, not enough for 250m);
cpus: "1", memory: 1G → s. Beyond xxxl, take xxxl and split the service.
Going further
- Sizes cannot be modified or extended by the tenant; no field allows free-form values.
- The
QuotaExceededmessage names the resource that blocks (requests.cpu,limits.memory…); since both ratios are 2, it is always the same size that overflows, whichever counter is named. - A container that exceeds its memory limit is restarted; if this repeats, move up one size rather than multiplying replicas.
See also
- Tiers
- Healthchecks and scaling
- Manifest reference (
Apppage)