[英]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.