bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cp oddity


From: Douglas Held
Subject: Re: cp oddity
Date: Thu, 16 Apr 2009 16:39:22 +0100

Adrian,

Forgive me if I'm overlooking something obvious, but I believe for
tests C and D you are creating 13000 processes; while for A, B and E
you are creating only one process.

I believe this alone should explain the discrepancy.

Regards,
Doug



On 4/16/09, Adrian Revill <address@hidden> wrote:
> Hi,
>
> I am not sure if this is a bug, but would appreciate some advise.
> If i use a single cp to copy multiple files, then read the files in
> inode order. I see faster disk access times than if i copy each file
> individually.
>
> I am using inode order as i have already determined that this
> drastically reduces the read times.
>
>
> Any ideas?
>
> Does anyone know the difference between copying multiple files in one cp
> command and copying the same files with multiple cp commands?
>
>
> The set up is this:
>
> A single disk freshly formatted with ext3 and mounted noatime,
> nodiratime on /test
> A set of test files, 13000 files avg 200KB, named numericaly 1 to 13000,
> written in pseudo random order in one directory (A) kept on a separate
> drive mounted on /data
>
> The test:
> # copy recursivly using cp
> cp -a /data/A /test/
>
> #copy all the files in A using cp
> mkdir /test/B
> cp /data/A/* /test/B
>
> #copy one file at a time in directory order
> mkdir /test/C
> for f in `ls -U /data/A`; do cp /test/A/$f  /test/C; done
>
> #copy one file at a time in file name order
> mkdir /test/D
> for f in `ls /data/A`; do cp /test/A/$f  /test/D; done
>
> #copy from D using a single cp command
> mkdir /test/E
> cp /test/D/* /test/E
>
> umount /test
> mount /test
>
> Now for each directory list files using ls -i, sort by inode number and
> in a loop cat to /dev/null
>
> /test/A takes 43s
> /test/B takes 43s
> /test/C takes 1m49s
> /test/D takes 1m49s
> /test/E takes 43s
>
> I have run these tests in different orders and always get the same
> results, even tried reformatting between each test.
>
> regards
> Adrian
>
>
>
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>
>
> _______________________________________________
> Bug-coreutils mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/bug-coreutils
>

-- 
Sent from Gmail for mobile | mobile.google.com

Douglas Held
address@hidden
+447986527654
+1 (415) 830-6123




reply via email to

[Prev in Thread] Current Thread [Next in Thread]