# Resource Pricing

Sunrise resource pricing is based on three independently billed dimensions: compute (CPU), memory (RAM), and persistent storage. Costs are calculated monthly against the `requests` values defined in each Namespace's `ResourceQuota`, making billing predictable and directly tied to provisioned capacity rather than variable runtime usage.

---

## Pricing Reference

| Resource | Unit | Price (CHF / month) |
|---|---|---|
| **Compute (CPU)** | 1 vCPU core (1000 millicores) | 5.50 |
| **Memory (RAM)** | 1 GB | 6.00 |
| **Storage** | 1 GB | 0.03 |

!!!info Over-commitment and billing
Over-commitment is permitted (a Namespace's `limits` may exceed its `requests`), but billing is always based on `requests`. Setting conservative requests and higher limits allows workloads to burst without increasing the base monthly cost.
!!!

!!!info GPU pricing
NVIDIA H100 GPUs are billed separately from the dimensions above. For current GPU rates and availability, [open a service ticket](https://support.ai.sunrise.ch/). See [GPU Infrastructure](./platform-architecture/gpu-infrastructure.md) for how GPUs are scheduled and consumed.
!!!

---

## Resource Truth Table

The table below defines the behaviour of each resource type across key operational dimensions.

| Dimension | Compute (CPU) | Memory (RAM) | Storage |
|---|---|---|---|
| **Unit** | vCPU (1000m) | GB | GB |
| **CHF / unit / month** | 5.50 | 6.00 | 0.03 |
| **Compressible** | Yes, throttled under contention | No, OOMKill if exceeded | No, fixed allocation |
| **Billing basis** | `requests.cpu` | `requests.memory` | `requests.storage` |
| **Quota field** | `requests.cpu` / `limits.cpu` | `requests.memory` / `limits.memory` | `requests.storage` |
| **Provisioning mechanism** | Kubernetes scheduler | Kubernetes scheduler | PersistentVolumeClaim (PVC) |
| **Excess behaviour** | Throttled (no pod eviction) | Pod evicted (OOMKill) | PVC creation blocked |
| **Dynamic scaling** | Cluster autoscaler | Cluster autoscaler | StorageClass provisioner |
| **Purchasable capacity (portal)** |, |, | 100 GB minimum; **100 GB steps** only  |

---

## Per-Resource Pricing Detail

### Compute (CPU)

CPU is measured in vCPU cores, where 1 vCPU = 1000 millicores in Kubernetes notation. CPU is a **compressible** resource: if a pod attempts to use more than its limit, it is throttled rather than terminated. Billing is based on `requests.cpu`.

| Namespace | CPU Requested | Monthly Cost |
|---|---|---|
| dev | 2 cores | 11.00 CHF |
| staging | 4 cores | 22.00 CHF |
| prod | 8 cores | 44.00 CHF |

---

### Memory (RAM)

Memory is measured in GB. Unlike CPU, memory is **non-compressible**: if a pod exceeds its memory limit, the kernel terminates it with an OOMKill signal. This makes accurate memory requests particularly important for production workloads. Billing is based on `requests.memory`.

| Namespace | RAM Requested | Monthly Cost |
|---|---|---|
| dev | 4 GB | 24.00 CHF |
| staging | 8 GB | 48.00 CHF |
| prod | 16 GB | 96.00 CHF |

---

### Storage

Persistent storage is provisioned via `PersistentVolumeClaims` (PVCs) against a configured `StorageClass` (e.g. Ceph RBD). Storage is billed per GB at a flat rate and is independent of compute and memory costs, allowing flexible cost modelling for data-heavy workloads.

You buy storage through the portal in **100 GB** increments only: **100 GB** minimum.

| PVC size (valid purchases) | Monthly cost |
|---|---|
| 100 GB | 3.00 CHF |
| 200 GB | 6.00 CHF |
| 500 GB | 15.00 CHF |
| 1200 GB | 36.00 CHF |

---

## Example Namespace Cost Calculation

The table below shows a combined monthly cost calculation for a production namespace with typical resource allocations.

| Resource | Allocation | Unit Price | Monthly Cost |
|---|---|---|---|
| CPU | 8 cores | 5.50 CHF | **44.00 CHF** |
| Memory | 32 GB | 6.00 CHF | **192.00 CHF** |
| Storage | 500 GB | 0.03 CHF | **15.00 CHF** |
| | | **Total** | **251.00 CHF** |

---

## Related Pages

- [OpenShift Architecture Overview](./platform-architecture/openshift-architecture-overview.md)
- [IaaS Capacity and Node Provisioning](./platform-architecture/iaas-capacity-and-node-provisioning.md)
- [Namespaces, Quotas and RBAC](./platform-architecture/namespaces-quotas-rbac.md)
