Skip to content

Commit a089c04

Browse files
committed
Added memory requests to be more realistic.
This makes Kubernetes make better choices about where to schedule the pods, and communicates to the administrators about the minimum sensible resource requirements. On a single user Mastodon instance on a three node Kubernetes after a week of so use we get these memory uses per pod: ``` tero@arcones:~$ kubectl top pods -n mastodon NAME CPU(cores) MEMORY(bytes) mastodon-elasticsearch-coordinating-0 6m 403Mi mastodon-elasticsearch-coordinating-1 28m 189Mi mastodon-elasticsearch-data-0 10m 1432Mi mastodon-elasticsearch-data-1 5m 1513Mi mastodon-elasticsearch-ingest-0 6m 418Mi mastodon-elasticsearch-ingest-1 6m 396Mi mastodon-elasticsearch-master-0 24m 466Mi mastodon-elasticsearch-master-1 10m 221Mi mastodon-postgresql-0 12m 276Mi mastodon-redis-master-0 16m 37Mi mastodon-redis-replicas-0 7m 34Mi mastodon-sidekiq-all-queues-549b4bb7b4-zvj2m 266m 499Mi mastodon-streaming-78465f778d-6xfg2 1m 96Mi mastodon-web-774c5c94f9-f5bhz 22m 418Mi ``` Hence we make the following adjustments to Bitnami defaults: - `mastodon-elasticsearch-coordinating`: `256Mi->512Mi` - `mastodon-elasticsearch-data`: The default `2048Mi` is ok. - `mastodon-elasticsearch-master`: `256Mi->512Mi` - `mastodon-redis-master`: `0->56Mi` - `mastodon-redis-replicas`: `0->56Mi` - `mastodon-postgresql`: `256->384Mi` And for Mastodon defaults: - `mastodon-sidekiq-all-queues`: `0->512Mi` - `mastodon-streaming`: `0->128Mi` - `mastodon-web`: `0->512Mi` The original idea of keeping these requests zero is a good default when minimal requirements are unknown. However, from a single user node we get minimal requirements and having the limits as zero only leads to trouble for people. Of course the system requirements will change over time, but they are chiefly expected to go upwards.
1 parent ae892d5 commit a089c04

File tree

1 file changed

+38
-14
lines changed

1 file changed

+38
-14
lines changed

values.yaml

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ mastodon:
8282
# -- (Sidekiq Container) Security Context for all Pods, overwrites .Values.securityContext
8383
securityContext: {}
8484
# -- Resources for all Sidekiq Deployments unless overwritten
85-
resources: {}
86-
# -- Affinity for all Sidekiq Deployments unless overwritten, overwrites .Values.affinity
87-
affinity: {}
85+
resources:
86+
requests:
87+
cpu: 250m
88+
memory: 512Mi
8889
# limits:
8990
# cpu: "1"
9091
# memory: 768Mi
91-
# requests:
92-
# cpu: 250m
93-
# memory: 512Mi
92+
# -- Affinity for all Sidekiq Deployments unless overwritten, overwrites .Values.affinity
93+
affinity: {}
9494
workers:
9595
- name: all-queues
9696
# -- Number of threads / parallel sidekiq jobs that are executed per Pod
@@ -162,13 +162,13 @@ mastodon:
162162
# -- (Streaming Container) Security Context for Streaming Pods, overwrites .Values.securityContext
163163
securityContext: {}
164164
# -- (Streaming Container) Resources for Streaming Pods, overwrites .Values.resources
165-
resources: {}
165+
resources:
166+
requests:
167+
cpu: 250m
168+
memory: 128Mi
166169
# limits:
167170
# cpu: "500m"
168171
# memory: 512Mi
169-
# requests:
170-
# cpu: 250m
171-
# memory: 128Mi
172172
web:
173173
port: 3000
174174
# -- Number of Web Pods running
@@ -180,13 +180,13 @@ mastodon:
180180
# -- (Web Container) Security Context for Web Pods, overwrites .Values.securityContext
181181
securityContext: {}
182182
# -- (Web Container) Resources for Web Pods, overwrites .Values.resources
183-
resources: {}
183+
resources:
184+
requests:
185+
cpu: 250m
186+
memory: 512Mi
184187
# limits:
185188
# cpu: "1"
186189
# memory: 1280Mi
187-
# requests:
188-
# cpu: 250m
189-
# memory: 768Mi
190190

191191
metrics:
192192
statsd:
@@ -231,6 +231,18 @@ elasticsearch:
231231
# @ignored
232232
image:
233233
tag: 7
234+
coordinating:
235+
resources:
236+
requests:
237+
memory: 512Mi
238+
ingest:
239+
resources:
240+
requests:
241+
memory: 512Mi
242+
master:
243+
resources:
244+
requests:
245+
memory: 512Mi
234246

235247
# https://github.com/bitnami/charts/tree/master/bitnami/postgresql#parameters
236248
postgresql:
@@ -253,6 +265,10 @@ postgresql:
253265
# you can also specify the name of an existing Secret
254266
# with a key of password set to the password you want
255267
existingSecret: ""
268+
primary:
269+
resources:
270+
requests:
271+
memory: 384Mi
256272

257273
# https://github.com/bitnami/charts/tree/master/bitnami/redis#parameters
258274
redis:
@@ -268,6 +284,14 @@ redis:
268284
# with a key of redis-password set to the password you want
269285
# auth:
270286
# existingSecret: ""
287+
master:
288+
resources:
289+
requests:
290+
memory: 56Mi
291+
replica:
292+
resources:
293+
requests:
294+
memory: 56Mi
271295

272296
# @ignored
273297
service:

0 commit comments

Comments
 (0)