V
V
vetsmen2019-11-12 21:53:54
JavaScript
vetsmen, 2019-11-12 21:53:54

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

2 answer(s)
X
xmoonlight, 2018-10-25
@xmoonlight

Instruction

A
Anton Neverov, 2019-11-12
@vetsmen

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 question

Ask a Question

731 491 924 answers to any question