简体   繁体   English

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

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

I am using Flask-uWSGI architecture for a production service and have set the master flag of uWSGI config as False .我正在将 Flask-uWSGI 架构用于生产服务,并将 uWSGI 配置的master标志设置为False While running the service, I pass NUM_WORKERS of uWSGI as 2 to the docker container.在运行服务时,我将 uWSGI 的 NUM_WORKERS 作为2传递给 docker 容器。 Based on this doc on uWSGI config , master flag is necessary to re-spawn and pre-fork workers.根据uWSGI config上的这个文档,重新生成和预分叉工人需要master标志。 I wonder if my service containers within the pods are actually using 2 workers?我想知道 pod 中的服务容器是否实际上使用了 2 个工作器?

So, I want to exec into a pod and see the number of uWSGI workers which are actually being used?所以,我想exec一个 pod 并查看实际使用的 uWSGI 工作人员的数量?

Not related but my uWSGI config:不相关,但我的 uWSGI 配置:

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

Add a prometheus-exporter to your app, and curl /metrics endpoint manually: https://github.com/timonwong/uwsgi_exporter将 prometheus-exporter 添加到您的应用程序,并手动 curl /metrics端点: https : //github.com/timonwong/uwsgi_exporter

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

Further, you can collect this using Prometheus to monitor and alert automatically.此外,您可以使用 Prometheus 收集这些信息以自动监控和警报。

暂无
暂无

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

相关问题 如何将 docker 容器添加到正在运行的 kube.netes pod? - How to add a docker container to a running kubernetes pod? 如何登录运行在特定Kubernetes容器内的Docker容器并运行test.sh文件? - How do I login into a Docker container running inside the specific Kubernetes pod and run an test.sh file? 如何使用 docker 容器创建 kubernetes pod - how to create kubernetes pod with docker container 如何检查 docker 容器内是否正在运行进程? - How to check if a process is running inside docker container? 如何从使用 KubernetesPodOperator 触发它的 Airflow 主机将卷挂载到运行 docker 容器的 Kubernetes Pod - How to mount a volume to a Kubernetes Pod running a docker container from the Airflow host that triggers it using the KubernetesPodOperator Kubernetes Pod - docker 容器内的 ssh 超时 - Kubernetes Pod - ssh time out inside docker container 如何在具有运行中的spring-boot应用程序的kubernetes容器/容器中运行cron? - How do I run a cron inside a kubernetes pod/container which has a running spring-boot application? 调试在 Kind(docker 中的 Kube.netes)集群上的 pod 内运行的 NodeJs 应用程序 - Debugging NodeJs app running inside pod on Kind (Kubernetes in docker) cluster 我有一个 python 脚本在 kubernetes pod 的容器内运行。如何停止与 pod 一起运行的脚本? - I have a python script running inside a container of kubernetes pod.How do i stop the script which runs along with the starting of the pod? Pod 内的 Kubernetes Docker 进程 - Kubernetes Docker process inside pod
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM