-- Lorin Hochstein USC Information Sciences Institute 703.812.3710 http://www.east.isi.edu/~lorin
On Jan 22, 2009, at 7:02 PM, Jesse Becker wrote: > On Thu, Jan 22, 2009 at 16:57, Lorin Hochstein <[email protected]> > wrote: >> For CPU usage (e.g. mulitcpu_user0) , I was expecting output like >> when >> you run 'top' and hit '1', where maximum possible CPU usage is 100% >> for each processor. > > This is, essentially, the "Solaris mode" of displaying CPU % where the > sum total over all CPUs will equal 100%. This is as opposed to the > "Irix mode", where each CPU can report up to 100% each; so on a 4-way > SMP system, you can, in total, have 400% usage. > I do like the current "Solaris" mode of reporting the total CPU % of the node out of 100%. >> Instead, the ganglia metrics effectively divide the CPU usage metrics >> by number of CPUs. For example, if there are 2 CPUs, the maximum >> value >> of multicpu_user0 seems to be 50%, if there are 4 CPUs, the maximum >> value is 25%, etc. >> >> Is there a reason why the chosen denominator is total time for all >> CPUs, rather than per CPU like "top"? > > It is easier to store. Only two values need to be tracked for all > hosts: a total CPU value, and number of CPUs. This is essentially > the "Solaris mode" described above. > > It does imply a loss of information. You no longer get specific > per-CPU values, but tracking this data would require a non-trivial > change on the backend daemons and webpages to implement. Notice that > I didn't say "hard," just non-trivial. > Would it be possible to implement things so that the multicpu metrics are modified to report 100% maximum, but the overall CPU metrics (e.g cpu_user) remain the way they are now, so that no changes would be necessary to the backend daemons and webpages? If my understanding of the code is correct, wouldn't this only involve modification of gmond/modules/cpu/mod_multicpu.c? In particular, wouldn't this simply require modifying the total_jiffies_func function so that calculations were done on a per CPU basis, like this (note: I didn't test this): --- a_mod_multicpu.c 2009-01-23 09:07:46.000000000 -0500 +++ mod_multicpu.c 2009-01-23 09:08:31.000000000 -0500 @@ -223,13 +223,14 @@ /* * A helper function to return the total number of cpu jiffies */ -static unsigned long total_jiffies_func ( void ) +static unsigned long total_jiffies_func (int cpu_index) { char *p; unsigned long user_jiffies, nice_jiffies, system_jiffies, idle_jiffies, wio_jiffies, irq_jiffies, sirq_jiffies; p = update_file(&proc_stat); + p = find_cpu (p, cpu_index); p = skip_token(p); p = skip_whitespace(p); user_jiffies = strtod( p, &p ); -- (Actually, I'll probably just hack up my local version to achieve this functionality, but it did help to "think out loud" in this email). Thanks, Lorin ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Ganglia-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ganglia-general

