I am currently looking at replacing our home brew batch processor with Gearman. It runs reports that can take up to several hundred megs of memory (PHP). As such, if too many of these reports are run the server will lock. I've had to add in logic to prevent the controlling process from spawning to many workers if memory is low and overloading our server and letting it crash.
If I switch over to Gearman is there some type of logic in place to prevent additional workers if system memory gets low? I see an option to limit workers, but this does not directly solve the issue. Additionally is it smart enough to balance the work load between systems if one system becomes overwhelmed?
What recommendations do others have out there? Is it possible for me to insert my own checks into Gearman to spawn workers when the conditions are right? Or what other solutions are there?
Developing on a LAMP stack and I'm not very familiar with Gearman, so rebuke where needed.