My system: django == 1.11.22, cchannels == 2.1.7, channels-redis == 2.2.1, daphne == 2.2.0, asgiref == 2.3.2
I tried using django pipes to include websockets in my project. The web socket subsystem simply sends system status to administrators and allows messages to be exchanged. My channel layer settings:
CHANNEL_LAYERS = {
'default': {
'BACKEND': 'channels_redis.core.RedisChannelLayer',
# 'BACKEND': 'channels.layers.InMemoryChannelLayer',
'CONFIG': {
"hosts": [(DJANGO_REDIS_HOST, DJANGO_REDIS_PORT)],
"capacity": 100000, # default 100
"expiry": 5 # default 60
},
},
}
I have increased the capacity of the channels to 100000 messages, but after 20-40 connections to the same URL "/ws/admins/" (this is one group "admins"), I start to get disconnects and duplicate messages, and django on the prod server will stop taking all connections until restarting docker containers. Decreasing expiry does not help either. if i use InMemoryChannelLayer then there are no errors. The server is started by the command: daphne -b 0.0.0.0 -p 8000 web_server.asgi: application