Understanding the time command
marius at pov.lt
Thu Aug 12 20:34:19 UTC 2010
On Thu, Aug 12, 2010 at 09:24:05PM +1000, Gary Jarrel wrote:
> I found that one of my systems runs a bit sluggish, and interestingly
> enough it's the one with the fastest processor and most memory. My
> feeling is that the problem is somewhere in HDD access (IO problem of
> some sort)
You're most likely right.
vmstat is a good tool for seeing what the system is doing.
> So before I spend countless hours on finding where the
> problem is I though I'd do one quick test as follows:
> time tar xvf file.tgz
> file.tgz is 600Mb in size and my results:
> System A (sluggish feeling)
> real 0m13.268s
> user 0m3.890s
> sys 0m13.090s
> System B
> real 0m12.918s
> user 0m3.300s
> sys 0m0.990s
> Now I am trying to understand why the huge difference in sys time but
> not in the others.
That looks weird to me too. I don't know why there's a difference in
accounting. If you look at vmstat or top during those 12 seconds, is
the CPU mostly spending time in iowait?
Still, the wall clock time is essentially the same, which is what
matters most in the end.
If you want a clearer breakdown of the 'sys' time, try
strace -c tar ...
and you will see a table summarizing the time spent in each system call.
I would expect to see system A doing read() and write() a lot.
> Some specs of the systems: System A - Core i7, 12GB RAM. System B -
> Core i5 8GB RAM!
> The main difference is System B runs an Adaptec RAID Controller with 2
> Seagate SATAII Enterprise drives while System A has a Samsung 750GB
> SATAII drive connected to the SATA controller of an MSI Motherboard!
> Any ideas would be welcome, as I really want to get this system up to
> scratch since it's my development machine.
I don't think there's anything you can do, short of buying a good solid
state disk. The wall clock difference is minuscule: only 0.3 seconds,
If the facts don't fit the theory, change the facts.
-- Albert Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 190 bytes
Desc: Digital signature
More information about the ubuntu-users