Skip to content

Commit

Permalink
Limit minio memory usage
Browse files Browse the repository at this point in the history
Normal memory usage is around 150Mi, but randomly the entire cluster
fail and minio uses 2.1Gi. We don't know why this happens, likely a bug
in minio. Add a hard limit to get minio killed if it tries to allocate
more than 300Mi.

Memory usage after starting the env:

    $ minikube ssh -p dr1 'top -b -o RES -n 1' | head -15
    ...
        PID USER      PR  NI    VIRT    RES  %CPU  %MEM     TIME+ S COMMAND
       1332 root      20   0 1416.8m 621.1m   6.7  10.5   1:25.59 S kube-apiserver
      11906 167       20   0 2235.8m 481.3m   0.0   8.1   0:50.51 S ceph-mgr
       7642 root      20   0 1754.0m 116.4m   0.0   2.0   0:00.77 S minio
        731 root      20   0 2323.7m 114.7m   0.0   1.9   3:15.37 S /usr/bin/containerd
       7288 dbus      20   0  868.2m 107.2m   0.0   1.8   0:05.94 S /bin/package-server

Memory usage after running minio self test 100 times:

    $ for i in $(seq 100); do addons/minio/test dr1; done
    ...

    $ minikube ssh -p dr1 'top -b -o RES -n 1' | head -15
    ...
        PID USER      PR  NI    VIRT    RES  %CPU  %MEM     TIME+ S COMMAND
       1332 root      20   0 1416.8m 651.5m   6.2  11.0   1:36.90 S kube-apiserver
      11906 167       20   0 2235.8m 485.5m   0.0   8.2   0:53.57 S ceph-mgr
       7642 root      20   0 1821.6m 209.0m   0.0   3.5   0:02.62 S minio
       1331 root      20   0   10.8g 118.5m   6.2   2.0   0:27.75 S etcd
        731 root      20   0 2323.7m 115.1m   0.0   1.9   3:16.98 S /usr/bin/containerd

Signed-off-by: Nir Soffer <[email protected]>
  • Loading branch information
nirs committed Mar 28, 2024
1 parent ebbcce7 commit 28f1659
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/addons/minio/minio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ spec:
- name: minio
image: quay.io/minio/minio:RELEASE.2024-03-15T01-07-19Z
imagePullPolicy: IfNotPresent
resources:
limits:
# Typical usage is 150Mi
memory: "300Mi"
args:
- server
- /storage
Expand Down

0 comments on commit 28f1659

Please sign in to comment.