Re: What is the most efficient way to copy a bunch of files nowadays?

From: Jan Engelhardt
Date: Thu Apr 13 2006 - 10:23:28 EST


>After having read-only mucked with the headers of a bunch of files[1]
>I've selected a subset of 2500 or so with sizes going from 2K to 85M
>which I want to copy to another directory in the same local
>filesystem. What is the "best" (

>CPU usage

nice

>fragmentation

What? You can't really influence it.

>wall clock time

Using a filesystem with aggressive caching.

>system responsiveness during and after the copy)

See one above. Set /proc/sys/vm/dirty_ratio high to have the flush taking
place late, or low to have it "early+often".

>way to copy these files? read+write, mmap+write, read+mmap,
>mmap+mmap+memcpy,

It all boils down to the same: read the file and write it back. So all
your methods cost equally much. With splice() instead of read/write
however, you may save some cycles.

>something else? That's with recent kernels, of course.


Jan Engelhardt
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/