etcd2.2.2 out of memory
i have created a 5 nodes cluster, as follows: 4 cpus /8G Mem /160G disk ubuntu 14.04
and the data which has been stored in the cluster is just about 80M, now the cluster is broken down[3 nodes out of memory], the part of log is: etcd_out_of_memory.txt
@xiang90
@magicwang-cn Can you reproduce this issue? Not only the data, but also watchers can consume memory.
@xiang90 yes, the problem has always exist. it just occur afternoon. and the log is the same as [etcd_out_of_memory.txt]. we just use etcd for kubernetes, and the k8s cluster is as follows: 1 k8s-master(with kube-apiserver) 400 k8s-node(with kubelet) 16000 pods(40 pods per node)
so what's the log meaning? i need help.
@magicwang-cn It means you run out of memory and your process get killed. You have to reproduce the problem independently.
Although you have 8GB memory, it does not mean that etcd can use all 8GB. In your case, k8s master will consume 3GB or so.
@xiang90 the 5 nodes etcd cluster is independently. k8s master is not installed with etcd.
@magicwang-cn We never met this issue. And I cannot reproduce your issue. We have been scheduling 30k pods into 1k nodes k8s cluster with etcd running on a 4 cores 8GB memory machine. You have to monitor the memory usage of etcd yourself and provide more information.
@magicwang-cn
16000 pod will generate roughly 160K keys into etcd. It will use 2GB memory at max. See https://github.com/coreos/etcd/blob/master/Documentation/benchmarks/etcd-2-2-0-rc-memory-benchmarks.md#data-size-threshold.
( etcd2 is not memory efficient either. We are working on etcd3, a memory efficient version of etcd. )
@xiang90 thank you for your help:) yesterday i have token the test(400 nodes, 16000 pods) again. and i found the situation as follows: first, definitely, this issue is cased by a param of kube-controller-manager(--kube-api-qps, from 20 to 100, and this can increase the rate of pods add/update/delete operation) second, also my doubt, batch creating pods will not occur this problem, but batch deleting pods does(they both use etcd watch method). final, i want to ask you is that has any constraint with etcd watch? if the watch receiver channel has not been read timely, the etcd mem use will increase?
details: in the process of deploying 16000 pods will not occur this problem, and the etcd mem use just about 800~900M(total 8G), the snapshort is just about 46M when i batch deleting pods , the etcd mem use increasing straight up, then OOM.
@magicwang-cn
when i batch deleting pods , the etcd mem use increasing straight up, then OOM.
Probably you should figure out why the usage increases. Do you know operations caused the memory increases? It might be a misuse of etcd? Can you reproduce this issue without k8s? Have you filed an issue in k8s repo?
/cc @wojtek-t since you know the usage of etcd in k8s better than me.
@magicwang-cn I am closing this out since it does seem like an etcd issue and also this is tracked in k8s repo. Please reopen if you can reproduce with etcd itself.