mattr has asked for the wisdom of the Perl Monks concerning the following question:
I'm designing a cross-platform application that will be able to fork processes but I don't want it to be a big CPU eater. Anybody have a good way to do so reliably?
CPAN says Sys::Load fails on Windows quite a bit, though there might be something accessible by Win32::API. Now I'm thinking of checking how long it takes to execute a command as processes are added but I'm not sure this will reflect actual niceness wrt other apps. Any experience here?
One option I suppose would be to give up and just specify a maximum number of processes, like apache does in its config file. Or some kind of concurrent scheduler for which you can dial the relative niceness. But I'd rather have as little configuration and as much intelligence as possible. Pure perl would also be a plus.
The end result would automatically keep it down to a small number of processes on a slow machine (or maybe at a time when cpu load is high for some reason) but would not blink at launching many processes if resources are available. Thanks for your help.
Matt
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Checking system cpu load when forking?
by EvanCarroll (Chaplain) on Nov 09, 2005 at 02:47 UTC | |
by mattr (Curate) on Nov 09, 2005 at 03:35 UTC | |
|
Re: Checking system cpu load when forking?
by Anonymous Monk on Nov 09, 2005 at 09:32 UTC | |
by mattr (Curate) on Nov 09, 2005 at 13:31 UTC | |
by BrowserUk (Patriarch) on Nov 10, 2005 at 13:22 UTC | |
by Anonymous Monk on Nov 10, 2005 at 09:55 UTC |