0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

OOMKilledがなかなか解消しなかった件

Last updated at Posted at 2024-01-16

原因

コンテナに割り当てられたメモリを使いきって、コンテナ内で OOM Killer にプロセスを殺されている。

従来の解決

.spec.template.spec.containers[].resources.limits.memoryの数値を増やして、コンテナが使用できるメモリの上限を上げる。

test.yml
apiVersion: batch/v1
kind: CronJob
...
spec:
  template:
    spec:
      containers:
        - name: app
              requests:
                  cpu: '100m'
                  memory: '8Mi'
              limits:
                  cpu: '100m'
                  memory: '32Mi' ←ここ

limits.memoryだけでは足りなかった

LIMITSはREQUESTSの倍ぐらいにしといてREQUESTSも調整が必要になる。

上記の設定でOOMが発生したのであれば
REQUESTS: 32Mi、LIMITS: 64Miが良い

  • request: アプリケーションが安定して稼働するのに最低限の値
    (OOMが発生しないようにするにはこっちを上げる必要あり)

  • limit: ノードに余裕がある場合にパフォーマンス向上のためにどれぐらい使ってよいかの限界値
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?