Javi Roman un jour écrivit:
On 2/9/07, Rajat Jain <rajat.noida.india@xxxxxxxxx> wrote:
Why not use a simple user space tool like sar / atsar etc?
Thanks,
Rajat
I don't know why, but a lot of people (google) say that this types of
tools are inaccurates.
It is true. The reason is that theses tools are not designed for what
you want to do. People that use them only care about monitoring general
ressource usage on servers and don't really care about realtime load or
exact load. They just want to have the big figure of the load patterns
over the day/week and be able to identify potential problems by having
more informations on their servers.
Also I would like understand in depth technics
about cpu usage meassures for real time purpouses.
You might be interested by OProfile. It will be able to provide you
very accurate informations. The Linux Trace Toolkit (LTT) is also
interesting for very precise mesurements. Then your problem will became
to know what you really want to mesure.
Another way to go is to do exactly like the command uptime, and
calculate it yourself using /proc/ entries. What we call the system load
is a quite artificial way of evaluating the CPU load, IO load and the
number of processes that are actively waiting for some resources from the
computer.
And because instantaneous values don't means anything useful, people
use average values over an arbitrary length of time (1, 5 and 15 minutes
for the command 'uptime').
It would be helpful if you told us more about what you really want/need
to do. My feeling is that you have an embeded system doing hard-realtime
and that you want to do something when the load is too high (or to do
something as soon that the load is low enough). The other possibility is
that you want to mesure very precisely how much ressources you are using
at each instant, but that you can analyse it afterward (in which case the
LTT could be very useful; Debian Sarge have a version for kernel 2.4.27, I
note it because the 2.4 kernel is not actively supported anymore).
Simon Valiquette
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/