Quote:
Originally Posted by m4rc
I've an question regarding disk I/O throughput.
The observation:
When I cp a 1 GB file within sd0 it takes about 100 sec.
|
At this point, the file's contents are stored in the drive's disk cache, and in RAM in the disk buffer cache.
Quote:
When I attach sd1 via USB2 and cp the file from sd0 it takes about 80 sec.
|
At this point, you are copying the file from RAM to the destination drive, across the horrible USB, which will never approach the full 40 MBps max throughput.
Quote:
When I cp this file back from sd1 to sd0 it takes about 40 sec.
|
At this point, you're basically just copying the file from the disk cache to the disk.
Quote:
Now I wonder why it takes longer to cp a file within sd0 than from/to sd1.
|
Read a portion of disk, move disk heads, write out to the same disk, move disk heads, read another portion of disk, move disk heads, write out to same disk ...
vs.
Constantly read source disk while constantly writing out to separate destination disk.
All you have to do is listen to the sound of the drive heads thrashing (copy to/from same disk) vs the sound of two drives' heads reading from one disk and writing to the other.