How to handle many socket connections

Hi, I’m currently programming a panel extension.

This extension should show some states from our EBS in realtime.
Therefor we want to open a connection between the viewers browser and our server (or later the AWS).
But this means:
If 40 streamers with 10k viewers each are using our extension, our server have to handel 400k socket connections at the same time.

Is there any best practice how to do this on server side without overloading the server?
(Current plan is to use python with flask. Good idea?)

Any hints which library/programming language is recommendet (or which not)?

A couple of suggestions:

  • Think long and hard about whether you need every client to be connected to your backend. Consider ways that this could be filtered or grouped. If a viewer is not interacting, do you really want/need a connection?
  • Look long and hard at the data that you want to send from a client to your EBS.
  • Consider the frequency of sending data from clients to your EBS. Consider aggregating data over a period of time.
  • Architect in elasticity into your EBS based upon demand (don’t under/over pay).
  • Pick a tech stack that you are the most comfortable working with/in.
1 Like