Using Granian 1.7.5, tested it with both Django and Quart under asginl and asgi modes respectively. The Python process under Granian seems to increase in RAM usage over time, most noticeably if the Python application is returning large responses like files.
Here's a small example using Quart
from quart import Quart
app = Quart(__name__)
@app.route("/")
async def hello():
return "A" * 4 * 1000 * 1024
and a small example with Django (generate a new project and then throw this into the root urls.py
)
from django.urls import path
from django.http import HttpResponse
def image(request):
return HttpResponse("A" * 4 * 1000 * 1024, content_type="image/png")
urlpatterns = [
path("", image, name="image")
]
Here's a graph showing the problem, this before when I was running with 1.7.5 and then after I downgraded back to 1.6.4. The large downspikes in memory usage on the left side is Kubernetes restarting the workers.
Git bisected the issue to this commit here 0741845
Thank you for this project!
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too