I'm not sure why you're getting the _UnixSelectorEventLoop - that sounds like a Twisted error you should search around for, and make sure you have the right package versions.
--fd 0 should not be needed in that command line, since you're already passing the UNIX socket, I don't remember why it's there.
I suggest you remove fd=0 and see if that then works with multiple processes.
Andrew
On Mon, Nov 26, 2018 at 3:10 PM Zhiyu (Drew) Li <zyli2004@gmail.com> wrote:
--Hi there,I am trying to migrate a tornado project to django channel2. I have moved all essential parts and wired them up in channel. It runs OK in development mode, but in production it seems the multi-daphne worker configuration is causing strange errors.AttributeError: '_UnixSelectorEventLoop' object has no attribute 'remove_timeout'I followed instructions on the official doc (https://channels.readthedocs.io/en/latest/deploying.html) to set up supervisor and nginx. But I am still lack of understanding how it works. Cloud you please explain more on the following settings?# TCP socket used by Nginx backend upstreamsocket=tcp://localhost:8000# Each process needs to have a separate socket file, so we use process_num# Make sure to update "mysite.asgi" to match your project namecommand=daphne -u /run/daphne/daphne%(process_num)d.sock --fd 0 --access-log - --proxy-headers mysite.asgi:application# Number of processes to startup, roughly the number of CPUs you havenumprocs=4Questions:What is "--fd 0" here? Is "0" the file descriptor for socket "tcp://localhost:8000" that Nginx is proxying to?What is "-u /run/daphne/daphne%(process_num)d.sock" then? Why do we need to set up separate socket for each daphne process? Are all the daphne processes already talking to "fd 0"?My website only works if I change either of the followingA) change to numprocs=1 ;OrB) remove "-u /run/daphne/daphne%(process_num)d.sock"ThanksDrew
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@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/CAMmsbU%3D-oPX_yZ7Kx8PmVfjwKJNSSC0hKOEUXyRGztzHogKGzA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@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/CAFwN1uq88vgWuJDuyrc7o7tEdu1OT%2BU-i6yXZ2JuCEUD2%3DXeiw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment