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
I'm encountering extreme latency when developing against Django Channels locally, generally on the order of ~20s. I implemented the basic chat tutorial, using group_send to broadcast messages to all members of the group. When I send a message, I expect to receive the echo'ed message immediately, but I don't receive it until around 20s later.
I am connected to a Redis server running in EC2 (this is the layer that backs channels), not a local Redis server.
When I deploy my simple application to Elastic Beanstalk and point the CHANNEL_LAYERS to the same Redis server, there is no delay. Using the same test code below (but changing the url to point to my webserver), I receive the echo'ed message instantly.
The delay only occurs when I am developing locally and launching the application using ./manage.py runserver. Any ideas on how I can resolve the local development latency?
This discussion was converted from issue #1732 on July 25, 2022 13:24.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
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
-
I'm encountering extreme latency when developing against Django Channels locally, generally on the order of ~20s. I implemented the basic chat tutorial, using
group_send
to broadcast messages to all members of the group. When I send a message, I expect to receive the echo'ed message immediately, but I don't receive it until around 20s later.I am connected to a Redis server running in EC2 (this is the layer that backs channels), not a local Redis server.
When I deploy my simple application to Elastic Beanstalk and point the CHANNEL_LAYERS to the same Redis server, there is no delay. Using the same test code below (but changing the url to point to my webserver), I receive the echo'ed message instantly.
The delay only occurs when I am developing locally and launching the application using
./manage.py runserver
. Any ideas on how I can resolve the local development latency?Settings:
Consumer code:
Test Code:
Django Channels Package Versions:
asgiref==3.2.10
channels==2.2.0
channels-redis==3.0.1
django==3.1.11
django-redis==4.12.1
Browser: Chrome Version 91.0.4472.114
Execution:
./manage.py runserver 0.0.0.0:5000
Beta Was this translation helpful? Give feedback.
All reactions