My customers publishing a stream to my origin server. And n edge server repeat the published stream. I want to limit connection count for published stream.

For example:

Connection limit of customer : 500
Edge server count : 3

Edge1 has : 150
Edge2 has : 200
Edge3 has : 100

50 anyother client can connect to published stream. After that connections will be reject.

I can do this with a httpProvider which is returning connection count on edge server for customer's stream then a cronjob collects this results from edge servers and update the db. But it is not efficient. Is there a way you can suggest ?