Re: Channels, Websockets and 'Backpressure'

2017-04-27 Thread Andrew Godwin
Hi Luis, If you are getting ChannelFull exceptions under load it means that the channels are not being drained fast enough, which means you need more worker processes. This means you should run more worker instances. If you are using Docker to run worker instances, you would run multiple copies

Re: Channels, Websockets and 'Backpressure'

2017-04-27 Thread Luís Antonio De Marchi
First I need to ask for patience with my English, the translator is helping. We are creating an project with forecasts of millions of connections per second. We've never worked with websocket before, I heard that Crossbar.io was better. But I've been playing with Django Channels for some time

Re: Channels, Websockets and 'Backpressure'

2016-12-01 Thread Andrew Godwin
On Thu, Dec 1, 2016 at 1:03 PM, Hank Sims wrote: > You set it in the channel layer configuration in Django, like this: >> https://github.com/django/asgi_redis/#usage >> > > Ah, thank you. Sorry I missed that. > > >> How would you propose this worked? The only alternative to

Re: Channels, Websockets and 'Backpressure'

2016-12-01 Thread Hank Sims
> > You set it in the channel layer configuration in Django, like this: > https://github.com/django/asgi_redis/#usage > Ah, thank you. Sorry I missed that. > How would you propose this worked? The only alternative to closing the > socket is to buffer the messages in memory and retry sending

Re: Channels, Websockets and 'Backpressure'

2016-12-01 Thread Andrew Godwin
On Thu, Dec 1, 2016 at 12:48 PM, Hank Sims wrote: > Thanks, Andrew. A few follow-up questions: > > 1. How would one go about increasing the default maximum queue size? I saw > some reference to this when I was researching the problem yesterday, but I > couldn't find the

Re: Channels, Websockets and 'Backpressure'

2016-12-01 Thread Hank Sims
Thanks, Andrew. A few follow-up questions: 1. How would one go about increasing the default maximum queue size? I saw some reference to this when I was researching the problem yesterday, but I couldn't find the setting that would change it. 2. Shouldn't there be a way to resolve the

Re: Channels, Websockets and 'Backpressure'

2016-12-01 Thread Andrew Godwin
"Backpressure" is designed exactly for what you describe, which is when clients are making requests of the server faster than you can handle them. Each channel has a maximum capacity of messages (100 by default), beyond which trying to add a new one results in an error. Webservers, when they see