How accurate/reliable are the cpu usage numbers shown by busybox "top"
for long-running multi-threaded processes?
Are they simply extract and shown as-is from /proc/<pid>/<whatever>,
or is the top code actually doing something?
If it's the former, this is probably off-topic for the busybox
list...
I'm working on performance issues for a smallish daemon which uses a
timerfd to trigger periodic polls of some custom hardware (the
hardware is mapped into userspace), and when it sees changes in input
values it distributes those new values to some client apps via Unix
domain sockets. [I've acually commented out the actual socket data
read/write code, so that isn't even happening.] The polling thread
runs with a high real time priority (Posix FIFO scheduler, priority=99).
I'm using busybox "top" (on an Atmel ATM9 w/ kernel 2.6.33.7 with
PREEMPT enable) to see how much CPU the daemon is using.
What's puzzling me is that the CPU usage show by "top" varies wildly
depending on the frequency at which set the timerfd for polling the
hardware. For example:
Poll Time (ms) CPU usage (%)
20.8 5
20.0 16
16.8 3
14.8 4
12.0 3
10.8 4
10.0 20
9.6 3
8.8 3
6.8 4
5.0 5
4.0 5
These CPU usage numbers are pretty stable and repeatable (they don't
vary over time or between runs by more than 1).
Is my app really using 6X as much CPU when polling at 10.0ms as it is
when polling at 10.8ms or 9.6ms? Or am I running into some sort of
issue with sampling/aliasing and they way CPU usage is measured?
--
Grant Edwards grant.b.edwards Yow! Edwin Meese made me
at wear CORDOVANS!!
gmail.com
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox