Home > Mobile >  Stuck on "Booting worker with pid: 7" while deploying a service in Kubernetes using Docker
Stuck on "Booting worker with pid: 7" while deploying a service in Kubernetes using Docker

Time:01-14

So basically i am trying to deploy a service in Kubernetes 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 i.e.

[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:

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..!!

CodePudding user response:

Try below possible Solutions :

I)Memory Issue :

1)Try adding more resources (requests & limits) under the container - may need more 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.

II)From Gunicorn side :

1)AsyncIO Workers : The worker gthread is a threaded 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. 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. Please check Gunicorn settings debugging for more information.

3)Create a Gunicorn config file using configmap and mount it to the web pod. Make sure bind is passed via config file, not through args. Please go through the Write Kubernetes manifests for python flask app for more information.

  • Related