Channels: about max message size

79 views
Skip to first unread message

Chris

unread,
Oct 23, 2018, 8:38:56 AM10/23/18
to Django users
I use Channels & websockets for my webapp's "export data" functionality, since it can take a long time to generate the file (more than 30 seconds). In general this works fine, even for large downloads (several MB), but I have seen several cases on Heroku where the browser never receives the message with the file, even though debugging shows that JsonWebsocketConsumer.send was called as expected.

I found this Github issue that says the message limit is 1 MB (or maybe 256 kb). My questions:

- Where is this limit defined? I searched the source of Channels and Daphne. I'm trying to figure out where the failure is happening -- in the worker, Daphne, or Redis.
- What happens if the limit is exceeded? Is an exception raised? (Because in my case it fails silently.)
- Is there really a 1 MB limit? Because it seems I have been able to send files larger than that using channels/asgi_redis (unfortunately I'm still on channels 0.17.3, can't upgrade yet because of a Twisted bug).

Thanks!

Andrew Godwin

unread,
Oct 23, 2018, 1:08:19 PM10/23/18
to django...@googlegroups.com
Hmm, it's possible the 0.x series didn't have response streaming for files so there'd be a limit, but I honestly can't remember, that was years ago. There's really not much I can do other than recommending an upgrade to something vaguely recent.

Also make sure Heroku is not cutting you off with a request timeout or something.

Andrew

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/da8fc1ab-8a75-4504-ab3a-6ab31cfd132e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chris

unread,
Oct 24, 2018, 7:18:15 PM10/24/18
to Django users
Thank you Andrew. Hope I can upgrade soon to get the Channels 2.X awesomeness :)
Reply all
Reply to author
Forward
0 new messages