gunicorn

ERROR:root:can't pickle fasttext_pybind.fasttext objects

ERROR:root:can't pickle fasttext_pybind.fasttext objects Question: I am using gunicorn with multiple workers for my machine learning project. But the problem is when I send a train request only the worker getting the training request gets updated with the latest model after training is done. Here it is worth to mention that, to make the inference …

Total answers: 1

Gunicorn worker terminated with signal 9

Gunicorn worker terminated with signal 9 Question: I am running a Flask application and hosting it on Kubernetes from a Docker container. Gunicorn is managing workers that reply to API requests. The following warning message is a regular occurrence, and it seems like requests are being canceled for some reason. On Kubernetes, the pod is …

Total answers: 10

standard_init_linux.go:219: exec user process caused: exec format error

standard_init_linux.go:219: exec user process caused: exec format error Question: I built and ran my dockerfile but am getting the error standard_init_linux.go:219: exec user process caused: exec format error. What does this mean and why is this happening per my configuration? DOCKERFILE: # 1 FROM python:3.9.2-slim # 2 COPY requirements.txt / RUN pip3 install -r /requirements.txt …

Total answers: 2

gunicorn with compiled python source

gunicorn with compiled python source Question: I have compiled my python files including gunicorn with PyInstaller on centOS 7. I’m trying to run those executables on another centOS 7 machine I’m getting ModuleNotFoundError: No module named ‘manage’ but my module manage is present in the same directory in executable form. Here is the full command …

Total answers: 2

Gunicorn gevent workers vs Uvicorn ASGI

Gunicorn gevent workers vs Uvicorn ASGI Question: I’m currently developing a service in Django which makes use of a slow external API (takes about 10s to get a response), which means the connections to my server are kept open waiting for the external API to respond, and occupying worker time/resources. I know I can use …

Total answers: 1

Gunicorn: stuck at booting new workers

Gunicorn: stuck at booting new workers Question: I have a rather simple Flask application (using fastAPI) for loading a numpy array and defining some API endpoints. import numpy as np import pandas as pd import logging from fastapi import FastAPI app = FastAPI() logging.basicConfig(level=logging.DEBUG) logging.info(‘Loading texts’) texts = pd.read_csv(‘cleaned.csv’) logging.info(‘Loading embeddings’) embeddings = np.load(‘laser-2020-04-30.npy’) # …

Total answers: 1

"[CRITICAL] WORKER TIMEOUT" in logs when running "Hello Cloud Run with Python" from GCP Setup Docs

"[CRITICAL] WORKER TIMEOUT" in logs when running "Hello Cloud Run with Python" from GCP Setup Docs Question: Following the tutorial here I have the following 2 files: app.py from flask import Flask, request app = Flask(__name__) @app.route(‘/’, methods=[‘GET’]) def hello(): """Return a friendly HTTP greeting.""" who = request.args.get(‘who’, ‘World’) return f’Hello {who}!n’ if __name__ == …

Total answers: 5

What is the difference between the two ways for launching flask?

What is the difference between the two ways for launching flask? Question: I have used two ways to launch a Flask application use python app.py directly use gunicorn -w 1 -b localhost:5000 app:app Then I printed the call stacks,I know the second way is better because it uses a wsgi server and can be used …

Total answers: 1

Unable to scale Gunicorn/Flask HelloWorld over 125 RPS

Unable to scale Gunicorn/Flask HelloWorld over 125 RPS Question: I have a Flask app that I have been unable to scale past 125 RPS locally. It is a simple ‘hello world’ as seen below. I’m using the Locust.io load testing tool. I have pointed the same load test to a local Golang hello world, and …

Total answers: 2

How to filter logs from gunicorn?

How to filter logs from gunicorn? Question: I have a Flask API with gunicorn. Gunicorn logs all the requests to my API, i.e. 172.17.0.1 – – [19/Sep/2018:13:50:58 +0000] “GET /api/v1/myview HTTP/1.1” 200 16 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36” However, I want to filter the logs to …

Total answers: 3