You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Server becomes completely unresponsive (freezes) after handling a small number of WebSocket messages through Django Channels. Response time degrades to 30+ seconds and never recovers, requiring container restart.
Symptoms
✅ Server starts normally and handles initial WebSocket connections fine
✅ First ~10-15 messages relay successfully (Mobile → Backend → Desktop via WebSocket)
❌ After ~19 messages in a few seconds, response time spikes to 30+ seconds
❌ Server stops responding to all requests (HTTP and WebSocket)
❌ No error logs, no panic messages - just silent freeze
❌ Container becomes unresponsive until manual restart
Architecture
Django Channels WebSocket consumers using:
Async Redis connection pool (redis.asyncio, max 50 connections)
Channel Layer for message routing between WebSocket consumers
Mobile → Backend → Desktop relay pattern (E2EE message forwarding)
Server should handle WebSocket messages continuously without freezing (like Uvicorn does).
Actual Behavior
Server freezes silently after ~19 messages with no error logs, requiring restart.
What I have noticed additionally is that it keeps working relatively fine until i start sending websocket messages slowly in faster intervals, but it's stil very small intervals.
Funny that if I run it on may windows machine, this issue doesn't persist or at list I haven't notice.
Additional Context
We were very excited to use Granian for its performance benefits, but had to switch to Uvicorn for stability.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Environment
Granian Start Command
granian --interface asgi --host 0.0.0.0 --port $PORT backend.asgi:applicationProblem Description
Server becomes completely unresponsive (freezes) after handling a small number of WebSocket messages through Django Channels. Response time degrades to 30+ seconds and never recovers, requiring container restart.
Symptoms
Architecture
Django Channels WebSocket consumers using:
redis.asyncio, max 50 connections)What We Tried (Did NOT Fix)
--runtime-threads(1, 4, 8, 16)--workerscountWhat FIXED It
✅ Switching to Uvicorn 0.38.0 completely resolved the issue - same code, same load, zero freezes.
Logs Before Freeze
Railway metrics at freeze time:
System Info
requirements.txt (relevant packages)
Reproduction Steps
Expected Behavior
Server should handle WebSocket messages continuously without freezing (like Uvicorn does).
Actual Behavior
Server freezes silently after ~19 messages with no error logs, requiring restart.
What I have noticed additionally is that it keeps working relatively fine until i start sending websocket messages slowly in faster intervals, but it's stil very small intervals.
Funny that if I run it on may windows machine, this issue doesn't persist or at list I haven't notice.
Additional Context
We were very excited to use Granian for its performance benefits, but had to switch to Uvicorn for stability.
Beta Was this translation helpful? Give feedback.
All reactions