I am working on new code for cpulimit which will allow the children of target processes to be monitored. The feature can be invoked using the "-m" or "--monitor-forks" flag on the command line.
While I'm still in the early testing stages of this and working to make the code cross-platform, you can test it now if you like by downloading the development snapshot here: http://resonatingmedia.com/cpulimit/cpulimit-2.4.tar.gz An example of the command in action might be cpulimit -l 25 -m -- my-exectuable The above command launches my-executable, limits its CPU usage to 25% and monitors any children spawned, also limiting them to 25% usage. If the target process's children also spawn children, those too are monitored. Which means the user needs to be very careful not to limit a core process like init as it could bring every process on the system to a crawl. For reasons I hope are obvious, if the target spawns a lot of processes, cpulimit will become decreasingly effective due to the increased demands of monitoring not only more processes, but watching their children too. When the target process dies, but child processes are still running, cpulimit should continue to monitor and throttle the child processes until they too exit. Again, this is a testing snapshot. It seems to be working okay for me on Debian, but I still need to make sure the code compiles and works on other platforms. If I don't get any bug reports, I'm finish my tweaks and then publish the new 2.4 version on the LimitCPU website. Jesse