On Fri, Jun 13, 2003, Ilya Konstantinov wrote about "Re: Testing on various computers
needed":
> 2. time dd if=/dev/zero of=foo
> says:
> real 0m10.449s
> user 0m0.260s
> sys 0m4.080s
> How come real ("wall clock") time is so much higher than user+sys combined?
This is simple - the disk can't write as fast as the CPU reads from /dev/zero
(i.e., generates a stream of zeros). So half the time, the CPU just waits
for the disk to finish to read. (remember, write buffers, however big they
are allowed to grow, still have a limited finite size).
> 3. nice -20 dd if=/dev/zero of=foo
> doesn't make it any more responsive!
>
> 4. ps shows only ~50% CPU usage.
> There's plenty of CPU time available for the rest.
The 50% CPU average doesn't take into account:
1. The possibility of having alternating seconds of inactivity and 100%
CPU utilization by the kernel (with no chance of any user process running).
If this happens, it's really annoying (especially if you're listening to
background music and it skips).
2. The possibility that no new data can be read or written from the disk
because it's busy. I don't know how good Linux is at reordering disk
requests, but even if it's great at it (and I doubt it) it's easy for
user commands (like "ls") to want to read or write and have to wait for
at least the current sector (and probably much, much, more) to be written
to disk.
I believe that a kernel *can* be designed to reorder disk requests, and
fairly throttle disk requests from multiple processes; Probably Linux as
it exists is simply not very good at this... But I don't really know.
> 5. Only operations which require reads from the hard drive (in my test, I
> write 'foo' to the system drive) cause the slowness. Other operations are as
> smooth as usual.
Which confirms my hunch that crappy request reordering is the root of this
problem.
--
Nadav Har'El | Friday, Jun 13 2003, 13 Sivan 5763
[EMAIL PROTECTED] |-----------------------------------------
Phone: +972-53-245868, ICQ 13349191 |Preserve wildlife -- pickle a squirrel
http://nadav.harel.org.il |today!
=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]