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 5 years have passed since last update.

minikubeでSystemOOMが発生した場合

Posted at

minikubeで色々遊んでいた時にeventでこんなものを発見

15m         Warning   SystemOOM                 node/minikube                                   System OOM encountered, victim process: mysqld, pid: 23389

どうやらOOMが発生しmysqldプロセスが殺されたらしい。。。

minikubeにmysqldがどう関係しているかはよくわかっておらず、minikubeの動作は問題なさげだが単純にminikube startして作成されたVMのサイズとかが気になって調べてみた。

以降はminikube sshしてから打ったコマンドです。

CPU

$ cat /proc/cpuinfo
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 142
model name	: Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
stepping	: 9
cpu MHz		: 2300.000
cache size	: 4096 KB
physical id	: 0
siblings	: 1
core id		: 0
cpu cores	: 1
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 22
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht pbe syscall nx pdpe1gb lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq dtes64 ds_cpl ssse3 sdbg fma cx16 xtpr pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch pti fsgsbase bmi1 hle avx2 bmi2 erms rtm xsaveopt arat
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs
bogomips	: 4608.00
clflush size	: 64
cache_alignment	: 64
address sizes	: 39 bits physical, 48 bits virtual
power management:

processor	: 1
vendor_id	: GenuineIntel
cpu family	: 6
model		: 142
model name	: Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
stepping	: 9
cpu MHz		: 2300.000
cache size	: 4096 KB
physical id	: 1
siblings	: 1
core id		: 0
cpu cores	: 1
apicid		: 1
initial apicid	: 1
fpu		: yes
fpu_exception	: yes
cpuid level	: 22
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht pbe syscall nx pdpe1gb lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq dtes64 ds_cpl ssse3 sdbg fma cx16 xtpr pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch pti fsgsbase bmi1 hle avx2 bmi2 erms rtm xsaveopt arat
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs
bogomips	: 4619.02
clflush size	: 64
cache_alignment	: 64
address sizes	: 39 bits physical, 48 bits virtual
power management:

vCPUは2です。

Memory

$ free -m
              total        used        free      shared  buff/cache   available
Mem:           1940        1168          26         486         744         258
Swap:             0           0           0

memoryは2GBです

minikubeが動いてるmacはメモリ16GBなのでminikubeの動くVMのメモリサイズとか調整しようと思います。

minikubeのドキュメントによるとデフォルトが2GBのようです。

minikube only allocates 2GB of RAM by default, which is only enough for trivial deployments. For larger deployments, increase the memory allocation using the --memory flag, or make the setting persistent using:

minikubeのメモリを4GBに増やすには以下のコマンドが必要になります

$ minikube config set memory 4096
⚠️  These changes will take effect upon a minikube delete and then a minikube start

ただこれは一度minikubeをdeleteする必要があります。
なので指示通り一度minikube deleteをしてからminikubeのメモリサイズを確認します。

$ minikube ssh
                         _             _
            _         _ ( )           ( )
  ___ ___  (_)  ___  (_)| |/')  _   _ | |_      __
/' _ ` _ `\| |/' _ `\| || , <  ( ) ( )| '_`\  /'__`\
| ( ) ( ) || || ( ) || || |\`\ | (_) || |_) )(  ___/
(_) (_) (_)(_)(_) (_)(_)(_) (_)`\___/'(_,__/'`\____)

$ free -m
              total        used        free      shared  buff/cache   available
Mem:           3940         616        1277         486        2046        2795
Swap:             0           0           0

ちゃんと4GBになってました。

とりあえずminikube環境なのでSystemOOMが発生しても大した問題ではないですが、どういう時にnodeでSystemOOMが発生するのか、今回殺されたmysqldプロセスはなんなのかなど時間がある時に調査しようと思います。
※mysqldプロセスはもしかしたらSystemOOMが発生した時に動かしていたmattermostコンテナのものかも...

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?