Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fastest way to move 90 million files (270GB) between two NFS 1Gb/s folders

Tags:

rsync

nfs

I need to move 90 million files from a NFS folder to a second NFS folder, both connections to NFS folder are using same eth0, which is 1Gb/s to the NFS servers, Sync is not needed, only move (overwrite if it exists). I think my main problem is the number of files, not the total size. The best way should be the way with less system calls per file to the NFS folders.

I tried cp, rsync, and finally http://moo.nac.uci.edu/~hjm/parsync/ parsync first took 10 hours in generate 12 GB gzip of the file list, after it took 40 hours and no one file was copied, it was working to 10 threads until I canceled it and started debugging, I found it is doing a call (stat ?) again to each file (from the list) with the -vvv option (it uses rsync):

[sender] make_file(accounts/hostingfacil/snap.2017-01-07.041721/hostingfacil/homedir/public_html/members/vendor/composer/62ebc48e/vendor/whmcs/whmcs-foundation/lib/Domains/DomainLookup/Provider.php,*,0)*

the parsync command is:

 time parsync  --rsyncopts="-v -v -v" --reusecache --NP=10 --startdir=/nfsbackup/folder1/subfolder2 thefolder /nfsbackup2/folder1/subfolder2

Each rsync has this form:

rsync --bwlimit=1000000 -v -v -v -a --files-from=/root/.parsync/kds-chunk-9 /nfsbackup/folder1/subfolder2 /nfsbackup2/folder1/subfolder2

The NFS folders are mounted:

server:/export/folder/folder    /nfsbackup2   nfs      auto,noexec,noatime,nolock,bg,intr,tcp,actimeo=1800,nfsvers=3,vers=3 0 0

Any idea how to instruct the rsync to copy the files already in the list from the nfs to the nfs2 folder? Or any way to make this copy efficiently (one system call per file?)

like image 764
Jose Nobile Avatar asked Nov 09 '22 02:11

Jose Nobile


1 Answers

I've had issues doing the same once and I found that it's best to just run a find command and move each file individually.

cd /origin/path
find . | cpio -updm ../destination/

-u command will override the existing files

like image 106
Karan Shah Avatar answered Dec 28 '22 14:12

Karan Shah