Closed nickoledimitrova closed 3 years ago
You can only have 1 server connection per worker. If you want to have multiple workers, you should run the program multiple times.
Having more than 1 worker per node instance won't result in any parallelism because node is single threaded.
I am using only one server, so this is why I was very confused why it was not handling jobs from the two workers (while running the program multiple times).
I managed to fix this by adding a preSleep function in the 'noop' function. Now all workers are handling jobs.
Thank you for your answer :)
I'm glad it worked out. :) Is this issue closable? By the way, what are you using gearman for? It's very old software now. I'm maintaining this module but surprised whenever anyone is using it over more modern and better approaches.
I'm glad it worked out. :) Is this issue closable? By the way, what are you using gearman for? It's very old software now. I'm maintaining this module but surprised whenever anyone is using it over more modern and better approaches.
It is totally closable, thanks!
It is used in a legacy project :)
Hello!
Firstly, nice work with this project!
I am experiencing issues with it when running workers on multiple instances. I have a Gearman client written in PHP that sends jobs to a worker in Node.js.
When using the helper function adminWorkers, I can see that there are two workers available, but only one of them is handling the jobs. I ran multiple tests and tried to send a lot of jobs in order to see if the reason is that the worker is handling the jobs too fast and they aren't reaching the other worker, but without any success.
How I'm using it:
I would appreciate your help!