When copying a multiple files, R2 takes forever to upload the last few files

I also have the same issue.

As you can see rclone copied 18557 files (~180 MiB/sec), then the rest stucked for maybe a half minute (that’s why average speed dropped down to 5.3 MiB/sec at the screenshot), then finishes the process. The files are correct, even the stucked ones: if I run again the rclone copy command, checksums are match, there are nothing to copy.

(Also there is the 502 error sometimes as you see, but rclone tries again at the end, then uploads correctly. It’s another issue, but I guess we do not want to discuss that in this tread.)

Code:
rclone copy do:bucketname/foldername r2:bucketname/foldername --exclude "**tmp**" -P --transfers=50 --fast-list --s3-upload-cutoff=100M --s3-chunk-size=100M --checksum

Any idea?