Mega Cp — Files
Recommendation: Don’t use mega-cp. Download to local temp, then upload. Or use rclone copy source: dest: with server-side copy disabled.
Recommendation: rsync -P or parsync + pv.
Why: Resumability + progress + optional compression.
When moving mega files over a network or creating backups, rsync is superior. Its block-checksum algorithm allows resuming. mega cp files
Command:
rsync --progress --partial --append-verify --stats -avh /source/mega_file.img user@server:/destination/
Test conditions:
| Operation | Speed (observed) | CPU usage | Reliability | |-----------|----------------|-----------|-------------| | Local → Cloud | 8–12 MB/s | Low | Stable | | Cloud → Local | 12–18 MB/s | Low | Stable | | Cloud → Cloud | 1–3 MB/s | Very low | Unreliable for >10GB |
Bottlenecks:
When "mega cp files" involves copying across a network, TCP window size and latency become the bottleneck. Do not use scp (it's notoriously slow for large files). Instead, use:
cp reads chunks of the file into memory, then writes them out. By default, Linux uses a small buffer (often 128KB to 1MB). For a 1 TB file, this means millions of tiny read/write cycles. This causes context switching overhead so massive that your CPU spends more time managing the copy than moving data. Recommendation: Don’t use mega-cp
| Tool | Key Feature | Speed vs cp |
|------|-------------|----------------|
| rsync --partial --progress | Resumable, progress | Slightly slower |
| dd status=progress bs=1M | Tunable block size, progress | Similar |
| pv source > dest | ETA, rate limiting | Adds overhead |
| cp --reflink=always (btrfs/XFS) | Instant copy (CoW) | Infinite speed |
| parsync (parallel rsync) | Multi-threaded copy | 5-10x faster on SSDs |
Example for 1TB file:
rsync -ah --progress --partial largefile.dat /backup/
# On destination (listener):
nc -l -p 9999 | pigz -d | dd of=mega_file.dat bs=64M
# On source (sender):
dd if=mega_file.dat bs=64M | pigz -c | nc dest_ip 9999