Django channels Realtime chat
Task build realtime chat, as well as sending / receiving notifications not related to the chat. A total of 2 real-time functions.
Tools backend - django frontend - Android Mobile App
Problem on a localhost, the code works, messages reach the client. Deployed on Heroku, the tariff is free. It turned out that there is a limit on connections = 20 (which is not enough for one user for 10 minutes). After each request, a new connection is created through ASGI, everything is ok for WSGI. To the limit - everything works, but when there are 20 connections, messages reach 2-3 times.
Attempts to solve 1. I registered in the code close_old_connections, it did not work to kill the connection. Those for each message creates a new connection. Googled for several days, did not find a solution on this issue. 2. I tried with both Daphne and Uvicorn - the effect is the same
Question maybe django-channels is not a suitable option for the task. Perhaps it’s worth abandoning Heroku, deploying to another hosting and raising Nginx, and all the restrictions will disappear?
The offial documentation says that django-channels should support up to 1000 connections, but then again, if a new connection is created with each message, then nothing will work.
If not through django-channels, then through what?