Initial stream delay across NGINX proxy
See original GitHub issueSetting up websocket communication using django-channels
with NGINX
as a proxy may be causing delay issues with Server-to-Client streams. The Server has to send exactly 24 messages regardless of message speed to the Client across the websocket before the Client begins to receive any data.
- Client connected directly to Django test server streams fine
- Client connected directly to Daphne streams fine
- With NGINX acting as proxy neither Django test server nor Daphne server streaming works until after 24 messages have been sent from Server
- Replaced Django server with Node.js socket server and streaming worked fine across NGINX proxy
- Tested connection to Django server through NGINX with both browser and Node.js wscat connection and stream delay existed on both
- If we send a message on connection (from Client to Django server) through NGINX proxy, streaming from server begins to function immediately after initial message
Given the above we believe the problem may exist within django-channels
as the problem only appears when django-channels
is integrated under a proxy with NGINX while Node.js client/server websocket architecture functions as expected.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
TCP and UDP Load Balancing | NGINX Plus
Load balancing refers to efficiently distributing network traffic across multiple backend servers. In NGINX Plus Release 5 and later, NGINX Plus can proxy...
Read more >Nginx proxy response time is very slow - Server Fault
I've found best results for ~300 req/s to be very short, around 1-3 seconds, but that will depend on your load.
Read more >Understanding Nginx HTTP Proxying, Load Balancing ...
With buffers, the Nginx proxy will temporarily store the backend's response and then feed this data to the client. If the client is...
Read more >How To Set Up a Reverse Proxy (Step-By-Step for Nginx ...
To understand what a reverse proxy server is, you need first to know ... For instance, if you want to watch a video...
Read more >How to setup an Nginx reverse proxy server example
Furthermore, Nginx buffers data to help manage heavy workloads, but this may be undesirable for applications that require the lowest latency ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ah, good to know. Thanks for leaving an update!
Yet another Update
You probably already received an email update about my last update…but it turns out the only other change I made in addition the the version update was to change the NGINX listen port from default port 80 to port 8000 and out of curiosity I reverted that change and found out that it was actually the port change that had fixed the problem.
Thus…this is probably not your problem after all. I apologize for wasting your time chasing a wild goose.