Kubernetes部署高内存使用率 [英] Kubernetes deployment high memory usage

查看:344
本文介绍了Kubernetes部署高内存使用率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在GKE contianer中使用python flask,并且pod内的内存增加了.我已经设定了Pod的限制,但是它被杀死了.

I am using python flask in GKE contianer and moemory is increasing inside pod. I have set limit to pod but it's getting killed.

我认为这是内存泄漏,任何人观看后都可以提出一些建议.随着磁盘的增加,内存也会增加,并且还会出现一些页面错误.

I am thinking it's memory leak can anybody suggest something after watching this. As disk increase memory also increase and there are some page faults also.

容器端linux os是否有任何东西(使用python-slim base).内存还没有恢复到os或python flask内存管理问题?

Is there anything container side linux os (using python-slim base). Memory is not coming back to os or python flask memory management issue ?

要检查内存泄漏,我已向应用程序添加了stackimpact.

To check memory leak i have added stackimpact to application.

请帮助...! 预先感谢

Please help...! Thanks in advance

推荐答案

如果在

If you added a resource memory limit to each GKE Deployment when the memory limit was hit, the pod was killed, rescheduled, and should restarted and the other pods on the node should be fine.

您可以通过运行以下命令找到更多信息:

You can find more information by running this command:

kubectl describe pod <YOUR_POD_NAME>

kubectl top pods

请注意,如果您发出的内存请求大于节点上的内存量,则将永远不会调度Pod.

Please note if you put in a memory request that is larger than the amount of memory on your nodes, the pod will never be scheduled.

如果由于资源不足而无法已计划或某些配置错误您可能会遇到一个错误,指示内存不足或其他资源.如果Pod处于挂起"状态,则意味着无法将其调度到节点上.在这种情况下,您需要删除Pod,调整资源请求或向群集添加新节点.您可以找到更多信息

And if the Pod cannot be scheduled because of insufficient resources or some configuration error You might encounter an error indicating a lack memory or another resource. If a Pod is stuck in Pending it means that it can not be scheduled onto a node. In this case you need to delete Pods, adjust resource requests, or add new nodes to your cluster. You can find more information here.

此外,根据此文档水平吊舱自动缩放(HPA)缩放基于内存或CPU使用率等指标的部署副本.

Additionally, as per this document, Horizontal Pod Autoscaling (HPA) scales the replicas of your deployments based on metrics like memory or CPU usage.

这篇关于Kubernetes部署高内存使用率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆