|
From: | Tom Pepper |
Subject: | Re: total cpu process bug? |
Date: | Fri, 6 Jan 2012 12:32:52 -0800 |
Hi, Martin: Can you clarify what exactly these two lines do in process.c's cpu percentage calculation? if (pt[i].cpu_percent > 1000 / systeminfo.cpus) pt[i].cpu_percent = 1000 / systeminfo.cpus; They're causing total cpu to be misreported when processes use a large amount of CPU and many cores are present. Shouldn't the "/ systeminfo.cpus" be dropped in both cases? I assume it's meant to keep any strange math from causing process cpu percentage to ever exceed 100%. For example, with a 120s query delay, a process I have on a 24 core box calculates with process.c's logic as: cputime = 4809915 cputime_prev = 4803601 (delta 6314) time = 13258814089.516930 time_prev = 13258812889.395201 (delta 1200) cputime - cputime_prev / time - time_prev = 6314/1200 = 5.26 1000 * 5.26 / 24 cpus = 219 "pt[i].cpu_percent" (which appears to represent 21.9% in monitese), which is accurate. 1000 / num_cpus is 41.6 on my box. since 219 >> 41.6 it gets cut back to 41.6. Thanks, -t On Jan 5, 2012, at 4:33 AM, Martin Pala wrote:
|
[Prev in Thread] | Current Thread | [Next in Thread] |