[英]Stuck on "Booting worker with pid: 7" while deploying a service in Kubernetes using Docker image, What seems to be the problem here?
So basically i am trying to deploy a service in Kube.netes cluster using a DockerFile, after so many attempts i am still stuck with the same error message Booting worker with pid: 7 on loop, without any exit code ie所以基本上我正在尝试使用 DockerFile 在 Kube.netes 集群中部署服务,经过这么多次尝试我仍然遇到相同的错误消息Booting worker with pid: 7 on loop,没有任何退出代码即
[2023-01-11 09:22:48 +0000] [1] [INFO] Starting gunicorn 20.1.0
[2023-01-11 09:22:48 +0000] [1] [INFO] Listening at: http://0.0.0.0:8080 (1)
[2023-01-11 09:22:48 +0000] [1] [INFO] Using worker: gthread
[2023-01-11 09:22:48 +0000] [7] [INFO] Booting worker with pid: 7
here is my Docker image:这是我的 Docker 图片:
FROM python:3.10-slim
ENV PYTHONUNBUFFERED True
ENV APP_HOME /app
WORKDIR $APP_HOME
COPY . ./
RUN pip install --no-cache-dir -r requirements.txt
CMD exec gunicorn --bind 0.0.0.0:8080 --workers 1 --threads 8 --timeout 0 main:app
I am really not getting where am i wrong, any leads would be super helpful..!!我真的不知道我哪里错了,任何线索都会非常有帮助..!!
Try below possible Solutions:尝试以下可能的解决方案:
I)Memory Issue:一)内存问题:
1)Try adding more resources (requests & limits) under the container - may need more memory. 1)尝试在容器下添加更多资源(请求和限制)——可能需要更多 memory。
2)Try to increase the available amount of RAM that the docker container, Please see SO for more info and also Clear the Cache
: log in the console of the backend
container, then issue the command bench --site SITE_NAME clear-cache
. 2)尝试增加 docker 容器的可用 RAM 量,请参阅SO了解更多信息并
Clear the Cache
:登录backend
容器的控制台,然后发出命令bench --site SITE_NAME clear-cache
。
II)From Gunicorn side: II)从 Gunicorn 方面:
1) AsyncIO Workers : The worker gthread
is a threaded worker. 1) AsyncIO Workers : worker
gthread
是一个线程化的worker。 It accepts connections in the main loop, accepted connections are added to the thread pool as a connection job.它在主循环中接受连接,接受的连接作为连接作业添加到线程池中。 On keepalive connections are put back in the loop waiting for an event.
在 keepalive 上,连接被放回循环中等待事件。 If no event happens after the keep alive timeout, the connection is closed.
如果在保持活动超时后没有事件发生,连接将关闭。
2) To use the inotify reloader, you must have the inotify package installed.
2)
To use the inotify reloader, you must have the inotify package installed.
Please check Gunicorn settings debugging for more information.请检查Gunicorn 设置调试以获取更多信息。
3)Create a Gunicorn config file using configmap
and mount it to the web pod. 3)使用
configmap
创建一个Gunicorn配置文件并将其挂载到web pod。 Make sure bind
is passed via config file, not through args
.确保
bind
是通过配置文件传递的,而不是通过args
传递的。 Please go through the Write Kube.netes manifests for python flask app for more information.请 go 通过为 python flask 应用编写 Kube.netes 清单以获取更多信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.