Re: Django Channels 2 poor performance and high CPU usage

2018-04-04 Thread 'James Foley' via Django users
Not exactly a solution, but after farting about with so many configurations I went back and tried channels 1.1.8. Looks like everything runs perfectly fine on 1.1.8 so I'm not sure what 2.x introduced that is causing me issues. On Wednesday, 28 March 2018 13:08:49 UTC+1, James Foley wrote: > > H

Re: Django Channels 2 poor performance and high CPU usage

2018-03-28 Thread 'James Foley' via Django users
Here is a quick and dirty example which is basically the core of what I'm trying to achieve. https://github.com/jamesfoley/django-channels-test/ Only other requirements other than those in the requirements.txt is redis server. Clone repo, install python 3 requirements using pip, runserver, ope

Re: Django Channels 2 poor performance and high CPU usage

2018-03-28 Thread 'James Foley' via Django users
The project I'm working on is a little sensitive. I'll put together a test project and try and reproduce my issues in the same environment, then push it to a repo for you to take a look at. On Tuesday, 27 March 2018 17:49:19 UTC+1, Andrew Godwin wrote: > > Not getting past HANDSHAKING with the

Re: Django Channels 2 poor performance and high CPU usage

2018-03-27 Thread Andrew Godwin
Not getting past HANDSHAKING with the in-memory layer is a bit weird, and scope is just a normal Python dictionary. Is it possible to put your code up somewhere in a simple form so I can look over it? Andrew On Tue, Mar 27, 2018 at 4:11 AM, 'James Foley' via Django users < django-users@googlegrou

Re: Django Channels 2 poor performance and high CPU usage

2018-03-27 Thread 'James Foley' via Django users
It looks like accessing scope for url kwargs is a big hit on performance. In fact hitting scope for anything seems to introduce some form of delay. I'm getting very mixed results so I'm unsure if this is now an issue with redis. It is definitely the python process using 100% of the CPU though.

Re: Django Channels 2 poor performance and high CPU usage

2018-03-27 Thread 'James Foley' via Django users
Apologies for the double post, I've removed the other one. PYTHONASYNCIODEBUG doesn't appear to give me any warnings. This test I am running is only between two users, each user belonging to the same group. All messages received are pushed back out to all users and filtered clientside. Assumin

Re: Django Channels 2 poor performance and high CPU usage

2018-03-26 Thread Andrew Godwin
(You double-posted this so I'm just going to reply to this one) I need to know a bit more information about what the slowdown is - in particular: * Have you run with PYTHONASYNCIODEBUG=1 set as an environment variable to check for non-yielding coroutines? * What sort of messages per second are we

Django Channels 2 poor performance and high CPU usage

2018-03-26 Thread James
I'm using Channels 2 to build a shared 3D model viewing tool, but I'm running into performance issues where Channels can't keep up and uses 100% of a single core. This results in clients just receiving a slow trickle of messages rather than the fast stream I was expecting. I ended up stripping