All Questions
125
questions
0
votes
0
answers
43
views
Read timeout unexpected behavior
I am migrating my an API microservice and among the changes I have switched Flask with FastAPI.
I have measured and tested and it seems that every route of my application is faster on the new ...
0
votes
0
answers
27
views
How to update ML model that was preloaded in Gunicorn
Below is a simple example of serving ML-model with FastAPI.
I want to run my gunicorn server like this: gunicorn --workers=4 --preload app.main:app --worker-class uvicorn.workers.UvicornWorker --...
0
votes
0
answers
52
views
Proper shm_size for a Docker container that will spawn multiple Google Chrome browsers
Currently, I´m working on a FastAPI app running via Uvicorn inside a Docker container. The app internally scrapes data from a website (let´s say similar to Wikipedia for the sake of the example) using ...
0
votes
0
answers
27
views
If I update the dependencies to the latest, I cannot see the traces
I am having a FastAPI (0.95.9) application. Using gunicorn with uvicorn.workers.UvicornWorker workers.
I am trying to auto-instrument it and pass data to a self-hosted Signoz platform.
When the ...
2
votes
1
answer
105
views
FastAPI lifespan event download model across multple gunicorn workers
I want to load a ML model to a local folder. However, I'm using gunicorn with multiple workers, so on startup each of them downloads the model:
from contextlib import asynccontextmanager
from fastapi ...
0
votes
1
answer
94
views
FastAPI gunicorn concurrent process worker behaving strange
I have a sample fastAPI code as follows.I have noticed that the requests to my server are not handled properly by gunicorn workers. I have 8 workers available via gunicorn command. I tested with 6 ...
0
votes
1
answer
2k
views
Issues with FastAPI Uvicorn workers | Only one worker is handling the request
I have a sample FastAPI application, with a single endpoint which returns the result a after a delay of 5 seconds.
Please find the code below.
from fastapi import FastAPI
import uvicorn, os, time
app =...
1
vote
0
answers
71
views
FastAPI fails spinning up worker
I am running FastAPI inside a docker container on my deployment VM. The image tests well on my develop OSX + Docker. Now, running it on the target machine it fails with the issue below.
It says max ...
0
votes
0
answers
153
views
Error is not being caught by FastAPI or Gunicorn
I'm currently getting a 502 error from my FastAPI app after making concurrent requests to the endpoints, which are calling OpenAI endpoints. The problem is, that I can't see the errors in the logs, ...
0
votes
0
answers
33
views
FastAPI backend is somehow stuck [duplicate]
I have a backend server which is a FastAPI server deployed with Gunicorn and Uvicorn worker class. Sometimes the server stops giving the response right away. I've checked the CPU and RAM usage all ...
1
vote
1
answer
565
views
Unable to run uvicorn under gunicorn in a Docker container
The following Dockerfile builds a working Fastapi demo app running under a single instance of uvicorn:
# example of a multistage build
# Stage 1: Builder
# Use the official larger Docker Python image
...
0
votes
0
answers
59
views
Gunicorn with sync workers and async endpoint [duplicate]
When we create a gunicorn using 2 workers and concurrently hit 20 requests then up to certain time requests are executed on different workers but then the requests start executing on the same worker ...
1
vote
0
answers
953
views
Gunicorn with 1 Worker works faster that Uvicorn for FastAPI app on single-core k8s Pod
I run my FastAPI application (Python 3.11.5) through the Gunicorn with 1 worker, using UvicornWorker class.
My Deployment in k8s contains 2 Pods with only 1 CPU-core for each. I thought about using ...
0
votes
1
answer
404
views
ChromaDB index update using gunicorn multiple uviworkers on macos throws YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__ error
I have created a simple FastAPI app for updating/uploading documents to ChromaDB Vectorstore on Mac OSX in-order to do a simple query search. Here is the below code,
import asyncio
from fastapi ...
0
votes
1
answer
406
views
How to log to StatsD using FastAPI and Gunicorn
I have a FastAPI that I am serving up using gunicorn. I am trying to send statistics to a DataDog agent on localhost that's running StatsD (DogStatsD) using the statsd_host argument described in the ...