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'
# TCP socket used by Nginx backend upstream
socket=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 name
command=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 have
numprocs=4
Questions:
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 following
A) change to numprocs=1 ;
Or
B) remove "-u /run/daphne/daphne%(process_num)d.sock"
Thanks
Drew