How to move large files over the network without suffering
Published on 2026-09-12 by frfrand
Why copying 200 GB with the wrong method takes three times longer, what rsync does that scp cannot, and how to diagnose if the bottleneck is in the disk, the network, or the CPU.

Short answer: To move large files, rsync is preferable to scp: it compares before copying, transfers only what is missing, and resumes if interrupted. Compress only data that compresses well and, with a slow network, package trees of many small files with tar; look for the bottleneck in the disk and CPU before the network, run long transfers inside tmux, and verify the result with a hash.
Copying a 200 MB file is straightforward. Copying 200 GB, or a hundred thousand small files, is another matter: interruptions, disk limits, and decisions arise that change the total time by a factor of three.
The difference between scp and rsync
scp copies. Period. If the connection is cut at 90%, you start from zero. If the file is already on the other side, it copies it anyway.
rsync compares before copying. It checks what is on the destination and transfers only what is missing or changed. If it is interrupted, it resumes from where it left off.
rsync -avzP origen/ servidor:/destino/
The flags, one by one:
- a (archive): preserves permissions, dates, and links, and descends recursively.
- v (verbose): shows what it is doing.
- z: compresses during transfer.
- P: equivalent to
--partial --progress: shows progress and keeps partially transferred files so they can be resumed.
One detail that bites: the trailing slash on the source matters. With "origin/" the contents of the folder are copied; without the slash, the entire folder is copied inside the destination. It is the most frequent cause of "I ended up with a folder inside another folder".
When to compress and when not to
The compression flag seems free and it isn't: it consumes CPU on both ends.
- It is worth it with text, code, logs, database dumps: they compress a lot.
- It is not worth it with already compressed files (video, images, zips): the CPU works to reduce nothing, and if the network is fast, compression becomes the bottleneck.
Practical rule: slow network and compressible data, compress. Fast network or already compressed data, don't.
Many small files is another problem
Transferring one hundred thousand 10 KB files is much slower than a single 1 GB file, even if the total is similar. Each file implies metadata, permissions, and a round trip.
The solution is to package on the source and unpack on the destination, in a single pipe:
tar czf - carpeta/ | ssh servidor "tar xzf - -C /destino"
This creates the package on the fly, sends it over SSH, and unpacks it on the other side, without writing an intermediate file. For trees of many small files, the difference is huge.
Where the bottleneck really is
Before blaming the network it is worth looking, because in half of the cases it is not the network:
- The disk. A mechanical disk is around 100 to 150 MB/s in sequential reading and much less with small files. If your network gives more than that, the disk is the limit.
- The CPU. With compression enabled and a fast network, the processor can be the bottleneck. It is noticeable by looking at CPU usage during the transfer.
- The network. Only now here.
An experiment that organizes the discussion: run the transfer without compression and compare. If it goes the same or faster, compression was getting in the way.
Two habits that avoid suffering
Use tmux. Any transfer of more than a few minutes should run within a tmux session. If your connection drops, the process continues on the server and you can see it again.
Verify at the end. Comparing the size is not enough: a truncated transfer can match. Comparing the hash does.
sha256sum archivo.tar.gz # on both sides
For database dumps and anything you will need seriously, that step is worth the thirty seconds it costs.
Example: moving a backup without interrupting the application
When moving large files between servers, it is advisable to measure sustained speed, retries, and integrity verification. rsync can resume useful transfers and sha256sum allows comparing finished files. For an active database, copying internal engine files without a coherent procedure does not replace a consistent backup.
If you manage VPS with ArduMaker, differentiate file transfer from application migration: in addition to the shared directory, you may also need to move the database, credentials, services, domains, and certificates. Plan a cutover or final synchronization window, and test that the new environment starts before changing DNS. For long transfers, the panel's web terminal runs on tmux: if your connection drops, the session continues on the server.
Frequently asked questions
rsync or scp for large files? rsync: transfers only what is missing or changed and can resume an interrupted copy. scp starts from scratch every time.
Is it worth compressing with -z? With text, logs, or dumps and a slow network, yes. With already compressed files or a fast network, it usually slows down the transfer.
How do I copy one hundred thousand small files quickly? Packaging them on the fly: tar czf - carpeta/ | ssh servidor "tar xzf - -C /destino".
How do I know the file arrived whole? Comparing the hash on both sides with sha256sum. Size alone is not enough.
Related: What is a backup · ArduMaker web terminal.