>From my point of view, You should avoid multi ws connections per client, the purpose of a ws connection is to be able to send data when something happens without a new user request, that being said... I think that the way DJ Channels is built makes it difficult to have just one connection per client since for each path in your router you have 1 consumer and for each consumer you have a websocket_connect method which creates a new ws connection so at first sight, is not clear how to avoid this behavior and some times is just not possible (At least not without too much effort). I have several apps with django channels with many customizations in order to reuse the main ws connection and it works but I'm not completely sure about the right way to achieve this (one ws connection per client). So, if someone has more experience with it, please share.
On Wednesday, December 21, 2022 at 9:01:47 AM UTC-6 di...@yodaplus.com wrote: > Hi Team, > currently I have deployed a Django project on EC2 server which has a RAM > of about 2GB using Gunicorn and Ngnix, I'm using Django channels on same > server, so as of now we have around 200 active users. currently each user > will have 5 active WebSocket connections/consumers (for chat, notification, > etc.) open so currently around 1000 open connections are present at a time. > As of now WebSocket's are working fine but in future we are expecting a > growth in user so as the active WebSocket connections will grow, and at > some point, due to excessive load, the server will start throwing issues > regarding socket connections my question is how to scale django channels. > Like should i just increase server size or is there any other solutions? > -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1e3f3607-88e9-49bf-94ed-35730e2a9f8an%40googlegroups.com.