Answer the question
In order to leave comments, you need to log in
How to count online from all workers?
There are N number of instances of workers, there is a remote balancer that distributes clients among them. The task is to count online users on them in total.
1) What is the best way to do this? I don’t want to be tied to the number of workers, I need some kind of public storage in redis, in which each worker would put his online storage, then take all this storage, sum it up and give the answer to the client.
2) Also, if the worker crashes, you need to reset it online to 0. Who should do this if the worker itself is no longer working?
Answer the question
In order to leave comments, you need to log in
Create a separate microservice that will poll the workers and add their data to the database. At the same time, you will find out who fell and who did not.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question