In my post about copying files on Solaris, I cover a modification that to GNU cp(1) that yields substantial performance improvements over the stock cp(1) when copying files on forcedirectio mounts. See my comments at the end of that post regarding non-forcedirectio mounts.
I’ve gotten a large number of requests for that code. I don’t have Solaris gear around here so I asked Padraig O’Sullivan to do the favor of testing the modified GNU cp(1) versus stock cp(1). Padraig states:
Here is his recipe for making a cp8M for solaris:
I used coreutils version 5.2.1 which can be obtained from here:
http://ftp.gnu.org/pub/gnu/coreutils/
In the coreutils-5.2.1/src directory I modified the copy.c file at line 287 with the following modification:
# diff -b coreutils-5.2.1/src/copy.c cp8m/copy.c
287c315
< buf_size = ST_BLKSIZE (sb);
—
> /* buf_size = ST_BLKSIZE (sb);*/
288a317,319
>
> buf_size = 8388608 ;
>
I then used the Makefile which is supplied with coreutils to build the cp binary.
Motives
The intent of this whole blog thread is really nothing more than diving into filesystem, and to some degree VM, internals topics so I truly hope that others will do this test. It would be interesting to see whether the mmap-enabled stock cp(1) is better than cp8M with, say, normal UFS mounts. The difference is clear to me on forcedirectio and that is, naturally, the type of mount I would take the most interest in.
0 Responses to “Copying Files on Solaris. Slow or Fast, It’s Your Choice. Part II”