automatically spawn new workers

Joe Stump joe at digg.com
Tue Dec 25 22:04:22 UTC 2007


> I've been trying to find out how to automatically spawn new workers  
> (like apache do this), but still can't find anything.
>
> Does anybody know if this is possible or not ?

This isn't *really* how Gearman works. You'd need to have a process  
monitoring how many workers are being actively worked and then spawn  
more from that. Gearman workers aren't on demand like Apache. Instead  
they connect to the Gearman server and then, basically, poll the  
Gearman server asking if it has any work for it to do.

For what it's worth I use a program called daemon to keep the workers  
I do start up and running (for instance, the PHP workers die if a non- 
Net_Gearman exception is thrown). There's really nothing to keep you  
from firing up more workers than you need. That's what we do.

--Joe



More information about the Gearman mailing list