Copy/sync of large buckets is very slow

Aperta
#10,254 1 commento 2 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 5 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
20/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
go

Direzione di ricerca

Start with fs/list/sorter.go, especially the disk sorting path referenced in the issue, and review the draft pull request #10253 to see the work already underway. The issue describes how entries are stored and rebuilt, and identifies checksum and size-only comparisons as examples; completion means avoiding a HEAD request per object when the listing already has the needed comparison data.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
Before you start
  • I have searched the forum and the existing issues for this problem.
  • I have tested with the latest beta or stable release and can still reproduce the problem.
  • This is a reproducible bug, not a usage question (questions belong on the forum).
Associated forum post URL

https://forum.rclone.org/t/slow-egress-on-v1-70-0-beta/51356/4

What is the problem you are having with rclone?

Above --list-cutoff directory entries were stored on disk by name only, so each object had to be recreated with NewObject. This costs one HEAD request per object even when the listing already holds what the comparison needs (e.g. --checksum, --size-only).

Root Cause

--list-cutoff was added to prevent OOM errors but now force any folder above the cutoff to fallback to disk and do 1 HEAD request per file.
https://github.com/rclone/rclone/issues/7974#issuecomment-3006166607

Feature status

The forum mentions that the current implementation is simple to ship faster.

At the moment we just serialize the name to disk in the sorting process and to rebuild the object rclone uses we need to do a HEAD request. In the future I'd like to serialize the entire object to disk which will get rid of that need for the HEAD request, but in order to get the feature out the door (and not have to add object serialization to every backend!) we decided to go with the simpler version.

The code also mentions it:

	// To start with we just use the Remote to recover the object
	// To make more efficient we would serialize the object here
Impact

This is is very impactful on large storages. The performance drops overnight and the cause is not obvious.

Workaround

Technically, splitting into folders could help go below the cutoff, but:

  • subfolders does not guarantee the threshold, only if folders are using an optimized path like de/deadbeef.
  • Path optimization is not needed for object storage, only disk storage.
  • Disk storage's path optimization often use 2-level de/ad/deadbeef which is also not efficient for rclone below 256M files.
  • Most software won't use paths to store on Azure/S3 as they don't need it.
rclone version

rclone v1.75.2 (note: issue since v1.70.0)

  • os/version: alpine 3.24.2 (64 bit)
  • os/kernel: 7.0.0-1015-oem (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.27.2
  • go/linking: static
  • go/tags: none
Operating system

Linux

Which cloud storage system are you using?

Azure, S3 mainly, Swift for some use-cases

Output of rclone config redacted
[azure]
type = azureblob
env_auth = true
account = XXX

[s3]
type = s3
provider = Other
env_auth = true
endpoint = XXX
access_key_id = XXX
secret_access_key = XXX
The command you were trying to run
`rclone copy --checksum --stats 2h --stats-log-level NOTICE azure:<container> s3:<container>`
A log from the command with the -vv flag
Information missing yet, will fill it later
Anything else?

PR already created in draft: https://github.com/rclone/rclone/pull/10253

Lingua principale
Go
Stelle
61.1k
Fork
5.7k
Merge medio
6g 15h
PR unite (30g)
51

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rclone/rclone

Tutte le issue di rclone/rclone

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.