apache / gravitino-playground

A playground to experience Gravitino
Apache License 2.0
31 stars 31 forks source link

[Bug] Avoid OOM (Out of Memory) for Playground-gravitino #66

Closed beryllw closed 2 months ago

beryllw commented 3 months ago

Add Gravitino jvm mem options to prevent the Gravitino Server process from being killed by the kernel's OOM killer.

gravitino.env.sh.template

# export GRAVITINO_MEM         # Gravitino jvm mem options Default -Xms1024m -Xmx1024m -XX:MaxMetaspaceSize=512m

docker-compose.yaml

  gravitino:
    image: datastrato/gravitino:0.5.1
    deploy:
      resources:
        limits:
          cpus: "0.5"
          memory: 500m
[四 8月 22 10:12:09 2024] [1439660]     0 1439660  1702258   135715  1871872     3968             0 java
[四 8月 22 10:12:09 2024] oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=docker-xxxxxxx.scope,mems_allowed=0,oom_memcg=/system.slice/docker-xxxxxxx.scope,task_memcg=/system.slice/docker-xxxxxxx.scope,task=java,pid=1439660,uid=0
[四 8月 22 10:12:09 2024] Memory cgroup out of memory: Killed process 1439660 (java) total-vm:6809032kB, anon-rss:504204kB, file-rss:38656kB, shmem-rss:0kB, UID:0 pgtables:1828kB oom_score_adj:0
shaofengshi commented 3 months ago

Hello Junbo, several questions: 1) In which case you will get the OOM error? 2) I see you add a "gravitino.env.sh" file, but didn't see where it will be called. Will it be executed automatically? 3) I see you increase the docker memory from 500m to 1G, is that mandatory? Can we just keep the origin value?

Thanks for your PR!

beryllw commented 2 months ago
  1. In which case you will get the OOM error?

Use gravitino-playground default config and refresh the gravitino homepage several times, I couldn't reproduce this time. I will close this pr.

shaofengshi commented 2 months ago
  1. In which case you will get the OOM error?

Use gravitino-playground default config and refresh the gravitino homepage several times, I couldn't reproduce this time. I will close this pr.

Thank you for the PR; I will test it to see whether I can reproduce it.