Slashdot Mirror


Quick, Standard Measurement for CPU Power?

captnitro asks: "A particular research project I'm developing right now needs to compare 'potential' (idle/none) and 'load' for various hardware capabilities, and quickly -- maybe up to a several times every minute. For disk space, for RAM, it's relatively easy -- find what's used and what's not and report the ratio. For CPU, I have plenty of time to test 'potential' when the app starts. But for testing CPU load, I need a standard 'ruler' that will be able to compare across varying platforms and processors (e.g., x86, PowerPC, embedded, single and multi-proc) -- so for example, idle percentage won't work. At the same time, I don't have the ability to time 'openssl speed' every 25 seconds without bringing the system to a halt. I'm willing to sacrifice precision of the measurement for generalization of the unit -- that is, the operations that this test is for would be primarily mathematical and not say, text sorts -- but I'd prefer a generic, quick test of the current processor load rather than an average of 25 different tests. Regardless of hardware, the OS distribution is mostly *nix-based -- NetBSD, Linux, and even Mac OS X. Wild ideas are perfectly acceptable -- any thoughts?"

31 comments

  1. Bogomips by Anonymous Coward · · Score: 2, Funny

    everyone understands bogomips, right?

  2. Potential CPU available ??? by MerlynEmrys67 · · Score: 4, Informative
    Well, first off - it is CPU available above a certain priority. I may be running a 100% cpu usage process at a very low priority - so there is no "left over" cpu to utilize, but an application can come in and get 100% of the CPU.

    I am not even sure there is a way of measuring what you want. There are so many variables (Disk I/O, memory bandwidth, etc.) that you can't get a reasonable measurement of how much CPU is left over to do useful work for your process.

    The other thing is that many things can take down a CPU as well - a huge burst of network traffic can take an "idle" CPU and peg it at 100% in kernal usage.

    Your best bet would probably be to hook into the various schedulers and get deep knowledge of what is really going on - pain in the butt, but doable

    --
    I have mod points and I am not afraid to use them
  3. How about by CounterZer0 · · Score: 2, Insightful

    Mhz? :)
    Or!
    Watts of thermal power on the die surface!

    1. Re:How about by Anonymous Coward · · Score: 0

      fan speed.
      bogo AuMont of shit that hits the fan speed.

      (the real question is why do you need it? measure it for what you need it for. Measure that task. For anything else bogomips is just fine. )

  4. go ahead and use idle percentages by Anonymous Coward · · Score: 0

    idle percentage won't work

    Why not? Just normalize it against total CPU capacity (MIPS, GFLOPS, or whatever). I'm probably not explaining it right, but I really don't see this as a difficult problem to solve.

    Hmm... maybe MIPS, GFLOPS, etc is the "ruler" you're looking for. If a processor can bechmark at 10GFLOPS (running at 100%), then a machine 90%idle is performing a maximum of 1GFLOP worth of work. It's sloppy as hell, but it might be good enough.

    1. Re:go ahead and use idle percentages by MerlynEmrys67 · · Score: 2, Interesting
      As mentioned above - for a general purpose OS - you have to take priority into account. I can keep a machine at 100% CPU utilization - and it will have 99+% available to anyone that comes along with a higher priority.

      What are those priorities, Interupt handling, high priority applications, ???

      What this person might be considering is some kind of batch job scheduling environment - where you want to schedule an incoming job on the system with the greatest current capacity to process it. ie. using free resources around the network to do useful work.

      --
      I have mod points and I am not afraid to use them
    2. Re:go ahead and use idle percentages by GigsVT · · Score: 1

      OpenMOSIX seems to use load average for this sort of thing.

      --
      I've had enough abrasive sigs. Kittens are cute and fuzzy.
  5. 'nice 19' to the rescue by Anonymous Coward · · Score: 0

    Run a dummy task at an extremely low priority. A bechmark of that task at the lowest possible priority will give you a good indication of how much CPU power was 'left over'. This will only work if you can make the dummy task a lower priority than everything else in the system.

    1. Re:'nice 19' to the rescue by Bishop · · Score: 1

      The only problem with this is that the nice 19 process will trash the CPUs cache. Even if the process is very low priority context switches are still expensive.

    2. Re:'nice 19' to the rescue by TheSunborn · · Score: 1

      No a task at nice 19 will still run even when a task with a nice 0 want to run.

      At least that was the case last time I tested with the linux 2.4 kernal.

  6. morone by Anonymous Coward · · Score: 0

    just use a voltmeter you idoit

  7. SPEC by machinecraig · · Score: 4, Informative

    It sounds like you are looking for a way to normalize and compare system (and application?) performance across different hardware platforms.
    Say hello to SPEC. This is exactly what the organization was formed for. Take a look at their CPU benchmarks. I know you're looking for more of a snapshot, and less of a benchmark - but I would think SPEC is a good place to start.

  8. Amps by nelsonal · · Score: 1

    Perhaps I am misunderstanding the question, but could you measure current flow to the CPU to measure its operating level? You know the idle current flow, and you know the expected peak draw, so by measuring current current flow through the processor you should be able to tell how loaded it is.

    --
    Degaussing scares the bad magnetism out of the monitor and fills it with good karma.
  9. openssl speed by p7 · · Score: 1

    You seem to hint that openssl speed is the type of metric you want... So why not run openssl speed once and use one of the tests as your power rating. For example say you choose blowfish cbc 8192 as the power rating. Total power for group of servers would be the sum of all the power ratings. Available processing power would server cpu idle % * power rating. A few simple scripts and you could have a rough approximation of available processing power available across all platforms. You could also design a benchmark based on the type of processing you will be doing, to make it more relevant.

    1. Re:openssl speed by TTK+Ciar · · Score: 1

      Yeah, that was more or less what I was thinking too, except I'd be tempted to use CPU temperature instead of power consumption, just because most hardware platforms already incorporate heat sensors for CPU's, and I don't know of any commodity hardware which will tell you how many watts your CPU is drawing.

      It would be imperfect, because other things can influence CPU temperature -- some CPU's have variable-speed fans (especially on laptops), and other factors can cause temperatures to rise inside the case (though in my experience, CPU temperature only changes a little as ambient case temperature increases). So you want to figure on a "jigger factor" to account for this variance, and understand that your measurement isn't going to be totally reliable.

      Moreover, surface temperature is not related perfectly linearly with watts dissipated. You should run some microbenchmarks to figure out what the curve looks like at 0%, 25%, 50%, 75%, 100% idle, and build a correction function to map temperature back to idleness fraction.

      So on application startup, you would first hold the CPU idle for a couple of seconds, and measure its temperature. Call that 10% idle (or whatever jigger you empirically determine). Then run openssl for a few seconds, and measure its temperature. Call that 90% idle (or whatever jigger you empirically determine). Then start the application, periodically checking the temperature of the CPU. Use your correction function to map the measured temperature to idleness fraction.

      I'm not sure how well it would work, but that's where I would start.

      Whatever you decide on, please write Slashdot back and let us know what you did and how it turned out!

      -- TTK

  10. Em Eye Ess by Ratbert42 · · Score: 1

    One Mississippi.
    Two Mississippi.
    Three Mississippi.

  11. Weigh energy consumption also by russellh · · Score: 3, Insightful

    Whatever you do, give energy consumption some weight in the comparison. In this day and age, low energy requirements is a virtue. In other words, for two CPUs that are otherwise equivalent, the one which consumes lower energy ought to win.

    --
    must... stay... awake...
  12. Easy - CPU Speeds by Anonymous Coward · · Score: 4, Funny

    Quick
    Fast
    Freakin Fast
    Holy Shit
    Dude you r0x0r
    OMFG

    Oh, just so you know, you should always buy at the Holy Shit level. If you buy OMFG you pay too much and you will soon regret buying anything less than Freakin Fast. But Holy Shit and you will be happy for a couple to three years without paying too much.

  13. Alas, not quick... by davecb · · Score: 3, Informative
    ... but standard, sufficiently so that it can be "gamed" (:-))

    The paper you're looking for is Wong, Brian, "Comparing MVS and UNIX Workload Characteristics" Int. CMG Conference, 1998, in which (if memory serves) he looks at the comparability of MVS and Unix programs, and derives a series of comparisons which very approximately correlate with TP performance in a benchmark like TPC.

    A paper that's available to CMG members is his Developing a General-Purpose OLTP Sizing Tool, which builds on the subject.

    If you have any good, representative test that load a whole system, then in my opinion, you have a good predictor of average performance. (Tautology, eh?) If you have such a test, though, people will learn how to get the best posible numbers from it. Average together all the various X MHz Pentium III TPC-C results, don't trust any single one (:-))

    --dave

    --
    davecb@spamcop.net
  14. quicky by vic5 · · Score: 1

    Setup a low end pc with a NIC and OS of your choice. Setup a share on the server to be tested. On your low end pc, write a script or "code" to move a small file to the server and then move it back. Log the rates, times and delta comparisons on the low end PC. Be sure to give the file a unique name each move. Something like the time stamp should work. You could, with the proper coding, derive a good bit of data without adversely affecting the test subject.

    --
    catch a wave and ride till ya hit the beach
  15. Flops by biryokumaru · · Score: 1
    A long time ago, back when engineers built computers instead of marketers, everyone talked about measuring things in flops. Flops was apparantly the well-rounded, accurate and objective measuring system. I believe I only see flops in regards to super computers these days, and it seems to be applied to measure their computational power.

    Consider:
    http://en.wikipedia.org/wiki/Flops
    http://en.wikipedia.org/wiki/Million_instructions_ per_second

    --
    When you're afraid to download music illegally in your own home, then the terrorists have won!
    1. Re:Flops by Nutria · · Score: 2, Funny

      back when engineers built computers instead of marketers

      Engineers now build marketers?

      --
      "I don't know, therefore Aliens" Wafflebox1
  16. Random idea.. by Anonymous Coward · · Score: 1, Interesting

    1) do some research on figuring out the relationship between Amps (current draw) and units of computation per time (like flops maybe). I.e., is it a linear relationship? Come up with a relationship.

    2) Using #1, calculate the current draw of CPU (perhaps use a separate dedicated power supply for the CPU and/or mobo) and therefore the current CPU utilization.

    You might need to address temperature in there too. Or *only* use temperature rather than current (for instance temperature difference between the outside of the case and the CPU).

    Just an idea. Some CPUs are more efficient than others so you have to scale it, but doesn't it make sense that CPU power is proportional to real power?

  17. Password Cracking by delirium+of+disorder · · Score: 1
    I've started a small project to measure cpu performance across platforms using john the ripper. You can see the results here:

    http://the1.no-ip.com/~the1/johnbench.txt

    You can download the john the ripper source code here:

    http://www.openwall.com//john/

    and then build it and run your own tests.

    --
    ------ Take away the right to say fuck and you take away the right to say fuck the government.
    1. Re:Password Cracking by delirium+of+disorder · · Score: 1
      --
      ------ Take away the right to say fuck and you take away the right to say fuck the government.
  18. Hmm... by op00to · · Score: 1

    Watts?

  19. Probably not SPEC, maybe javascript or flash.... by UnapprovedThought · · Score: 1

    Not enough information was given in the question, but it is possible that the application in mind is that of measuring the performance of webservers in real time. So the experimenter doesn't (or does?) want the tests to last the long time a good SPEC run would take. I was somewhat confused by the article text.

    Then again, it's possible that the application could be used to measure the speed of web clients. In that case, a flash or javascript loop with whirling icons could do the trick, but it would take some work. Since it's possible that this may be used (either now or in the future) by marketers who want to measure the comparative speed of a computer (to use to categorize someone into a marketable demographic so they can "target" the right ads), maybe answering this question fully wouldn't be such a good idea.

  20. are we doing your homework? by Anonymous Coward · · Score: 0

    "...needs to compare 'potential' (idle/none) and 'load' for ... CPU ... test 'potential' when the app starts."

    what is the app? is it your app, only one app, could be any one of hundreds of apps?

    "need ... 'ruler' ... compare ... x86, PowerPC, embedded, single and multi-proc ..."

    "idle percentage won't work"
    because you want to know how much work you can do

    "sacrifice precision of the measurement for generalization of the unit"

    "generic, quick test of the current processor load ... mostly *nix-based"

    "thoughts?"

    standard guage, just measure the right stuff

    if all apps belong to you, just calibrate according to results rate...

    full = no aps running therefore no rate

    empty = all apps running therefore full rate

    guage = empty rate - current rate

    That's $20 + % gross rev, if it works...

  21. Potential CPU available vs benchmarked CPU by arete · · Score: 1

    CPUs aren't comparable, so you need to get a % and normalize it.

    The easiest way to get a % is from something like top - but you can definitely do better, especially by successfully taking into account priority. You definitely want to find a way to _access_ information the scheduler already has, not make little minibenchmarks.

    But you still have the problem of 100% of a PII vs 100% of a G5. This is a principally insoluble problem that varies based on your application's use of int, flop, registers, L1, L2, memory bandwidth and offloading chips (such as better NICs)

    An ok solution would be to read the CPU class and do a lookup in a table that you keep upgrading as you get better info. My shorthand table is at the bottom of this post.

    A better solution would be to do a relevant CPU-intensive benchmark on each machine and store that result. If what you care about is OpenSSL speed, that's the best benchmark FOR YOU.

    The best solution is to run a series of full-setup benchmarks. Run it at high, middle and low memory usage, since you're measuring that separately, etc... then do all combination with high/low disk bandwidth. Run it at high/med/low CPU based on whatever % measure you settled on. You'll get not just a number but a "map" of performance based on other factors. If this matrix is very detailed it might automatically perform hundreds of combinations and take a long time once, but you'd get very accurate results.

    I'm interested to see your results, but until you take them, this is my ruthlessly shorthand table which disregards huge amounts of things and wildly approximates all sorts of things and some stuff I've made up:
    P4 CPU speed x1
    P3 CPU speed x1.2
    P2 CPU speed x.8
    Athlon XP xxxx+ rated speed.
    G3 CPU speed x1.8
    G4 CPU speed x1.5
    G5 CPU speed x2
    Dual CPU x1.7 (probably dual core also)
    Quad CPU x3 (probably dual/dual cpu/core also)

    (please note: PIIIs definitely were often clock-for clock faster than early PIVs, at least. But they couldn't scale up. Same with G3 vs G4. Note that chess is highly integer and nothing is better than an Intel, apparently.)

    --
    Looking for freelance Actionscript (Flash/Flex) or ColdFusion work and/or freelance developers. Email me, put Slashdot