Checking Gearman Worker Status on a Specific Machine

I start the Gearman server with Gearman Manager , with their PHP interface. setting is below. The Gearman server can be either on one of two machines, or on a third machine.

enter image description here

For my implementation, I should be able to tell from one employee if another worker on the same machine is busy or free. for example, I should be able to tell if Worker 2 is working on machine 1 from Worker 1 on machine 1. Can this be done either with the PHP API or with telnet?

Possible Solution

In the Telnet interface, the "WORKERS" command gives you a list of all the workers connected to the server, along with their ips. I believe that I can use this to accomplish my task. I found a PHP script to get this information using telnet.

+5
source share
1 answer

I suspect that your proposed solution is less optimal, but you did not provide any information about the problem you are trying to solve, so I will try to answer the question as it is. You will need to communicate between your employees, and telnet is probably the less ideal solution. You might want to look into something like the Red / pub / sub messaging system for interprocess communication. Just for workers to publish and subscribe to a channel based on a machine’s name, and develop a simple way to broadcast workers' status.

0
source

Source: https://habr.com/ru/post/1236766/


All Articles