Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: Checking system cpu load when forking?

by mattr (Curate)
on Nov 09, 2005 at 03:35 UTC ( [id://506974]=note: print w/replies, xml ) Need Help??


in reply to Re: Checking system cpu load when forking?
in thread Checking system cpu load when forking?

Hi, and thanks for the reply! To clarify..

  • The objective is that I want my app to work quietly without slowing down the system even if it is being run on slow hardware or on hardware the resources of which are already in high demand i.e. by virus checking, printing, etc. The question is how to tell how busy the machine is, and to do so reliably with a minimum of interaction and a minimum of hassle whether the machine is a windows 98 pc, a linux laptop, a mac, or some windows or linux server.
  • Sys:Load works on linux so I mentioned Win32::API with the idea that I might have to think up some alternate strategy to be used in case we are running on a windows machine. Which I don't want to do.
  • Yes, I've read the Sys::Load docs (a related page also says it is limited to systems with getloadavg() apparently) and it works fine on linux anyway. Haven't tried it anywhere else. I was hoping Sys::Load would help since it returns an average of cpu load for the last minute. This knowledge would let the software take action when it load is above 0.8. It might tell a user that it is not a good idea to add more concurrent jobs, or it might choose to prioritize, delay or offload some things. Wallclock doesn't tell you how hard the machine is working. It is more about useability and figuring out whether more resources should be added.
  • I do have some studying to do, though I have of course read about Parallel::Forkmanager which I plan to use, and POE which I would also like to use in places. I haven't used these modules yet though, and I am not so familiar with perlfork. (The links you provided about perlipc and perlfork are quite nice, I'll go through them, thank you). I hope this is enough information. It would be nice if there was a PP heuristic to figure out how much you are stressing a machine and also to derive a baseline for how much power the machine has so you can plan resource loading in advance. Also I don't want to rewrite a module or require tweaking even when moving between machines. However if necessary I'm willing to consider a collection of two or more platform-specific solutions to figuring out the cpu load (and maybe available bandwidth and disk space too)
  • Comment on Re^2: Checking system cpu load when forking?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://506974]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-25 19:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found