Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion charts/restate-helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,26 @@ Helm chart for Restate as a single-node StatefulSet.
helm install restate oci://ghcr.io/restatedev/restate-helm --namespace restate --create-namespace
```

# Resources
Restate's performance is strongly influenced by the CPU and memory available. You can vary the resources in your values file.
The defaults are:

```yaml
resources:
limits:
cpu: 6
memory: 8Gi
requests:
cpu: 4
memory: 8Gi
```

The environment variable `RESTATE_ROCKSDB_TOTAL_MEMORY_SIZE` should be set such that it is roughly 75% of the memory available.
In the default helm values, this variable is set to `6Gi`.
Under load, Restate will eventually use the entire RocksDB memory size offered to it.

# Running a replicated cluster
You can find example values for a 3-node replicated cluster in [replicated-values.yaml](./replicated-values.yaml).
You can find example values for a 3-node replicated cluster in [replicated-values.yaml](./replicated-values.yaml).
Please ensure you use a version of that file (based on the git tag of the repo) which matches the version of the helm chart you are deploying.

```bash
Expand Down
15 changes: 10 additions & 5 deletions charts/restate-helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,23 @@ env:
value: json
- name: RESTATE_CLUSTER_NAME
value: helm-single-node
- name: RESTATE_ROCKSDB_TOTAL_MEMORY_SIZE
# This value should be around 75% of the container memory limit, which defaults to 8Gi below.
# If provisioning restate with a different memory limit, make sure to update this value
value: 6Gi
Comment on lines +42 to +45
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The one alternative I was thinking of is whether we could use K8s downward API to automatically derive the value based on the configured memory limit (specific to the helm chart). But it would also add some form of auto magic (which probably should only happen if the rocksdb total memory hasn't been set explicitly).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not easily... we can indeed get the memory request or limit as an env var, but it wont necessarily be a byte count, it would be something like '2Gi' which needs parsing and them multiplying by 0.75 or whatever. imo if we do this we should do it inside Restate, with an option to set memory to some ratio of the process memory limit (which we try to get from the cgroup)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but i am largely against this kind of magic, best to solve this with clear documentation. imo, a docs page like 'these are the 4 parameters you should pick when building a new cluster' would be really helpful


service:
type: ClusterIP
annotations: {}

resources:
limits:
cpu: 1
memory: 3Gi
cpu: 6
# note the comment above re 'RESTATE_ROCKSDB_TOTAL_MEMORY_SIZE'
memory: 8Gi
requests:
cpu: 500m
memory: 1Gi
cpu: 4
memory: 8Gi

storage:
# If provided the volume will be mounted with the specified claim
Expand Down Expand Up @@ -87,4 +92,4 @@ topologySpreadConstraints:
# podDisruptionBudget:
# maxUnavailable: 1

nodeSelector: {}
nodeSelector: {}
Loading