繁体   English   中英

如何检查在 kubernetes pod 的 docker 容器内运行的工人数量?

[英]How to check the number of workers running inside a docker container of kubernetes pod?

我正在将 Flask-uWSGI 架构用于生产服务,并将 uWSGI 配置的master标志设置为False 在运行服务时,我将 uWSGI 的 NUM_WORKERS 作为2传递给 docker 容器。 根据uWSGI config上的这个文档,重新生成和预分叉工人需要master标志。 我想知道 pod 中的服务容器是否实际上使用了 2 个工作器?

所以,我想exec一个 pod 并查看实际使用的 uWSGI 工作人员的数量?

不相关,但我的 uWSGI 配置:

[uwsgi]
socket = 0.0.0.0:9999
protocol = http
module = my_app.server.wsgi
callable = app
master = false
thunder-lock = true

将 prometheus-exporter 添加到您的应用程序,并手动 curl /metrics端点: https : //github.com/timonwong/uwsgi_exporter

它有 num 个工人指标: https : //github.com/timonwong/uwsgi_exporter/blob/9f88775cc1a600e4038bb1eae5edfdf38f023dc4/exporter/exporter.go#L50

此外,您可以使用 Prometheus 收集这些信息以自动监控和警报。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM