-
Notifications
You must be signed in to change notification settings - Fork 97
Open
Description
Describe the bug
I implemented rate limiting with default values, so the storage being used is local memory and running uvicorn with 8 workers.
For a end point with rate limit 5/minute
, when I am hitting the endpoint in a for loop, I am able to hit for more than 10 times without any rate limiting. Is it due to multiple workers?
But isn't the memory shared between workers, so that the rate limit should work across workers?
To Reproduce
limiter = Limiter(key_func=get_remote_address)
@app.get("/home")
@limit.limiter("5/minute")
async def home(request: Request):
return {"message": "hello"}
Expected behavior
N/A
Screenshots
N/A
Your app (please complete the following information):
- fastapi or starlette? FastAPI
- Version? 0.111.1
- slowapi version (have you tried with the latest version)? 0.1.9
Additional context
Add any other context about the problem here.
jacobowitz
Metadata
Metadata
Assignees
Labels
No labels