What is the problem you are having with rclone?
Increasing memory usage when using sync
/lsf
with a directory that has millions of files.
I'm trying to follow the same steps here to transfer files from S3 to Wasabi, but the lsf
command keeps running out of memory.
Run the command 'rclone version' and share the full output of the command.
$ rclone --version
rclone v1.59.1
- os/version: ubuntu 22.04 (64 bit)
- os/kernel: 5.15.0-1017-aws (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.18.5
- go/linking: static
Which cloud storage system are you using? (eg Google Drive)
AWS and Wasabi S3
The command you were trying to run (eg rclone copy /tmp remote:tmp
)
rclone lsf \
--max-age 2022-08-17T17:09:00Z \
--absolute \
--transfers 16 \
--no-gzip-encoding --ignore-checksum \
--rc --rc-no-auth \
--use-mmap --s3-memory-pool-use-mmap \
aws:tarteel-session-data/sessions > object_names.txt
I've also tried with/out --use-mmap --s3-memory-pool-use-mmap
, --transfers
, and --no-gzip-encoding --ignore-checksum
The rclone config contents with secrets removed.
[wasabi]
type = s3
provider = Wasabi
endpoint = s3.us-west-1.wasabisys.com
location_constraint = us-west-1
acl = private
[aws]
type = s3
provider = AWS
region = us-west-2
location_constraint = us-west-2
A log from the command with the -vv
flag
2022/08/17 18:18:41 DEBUG : --max-age 1h9m41.985581351s to 2022-08-17 17:09:00.000015691 +0000 UTC m=-4181.968370533
2022/08/17 18:18:41 DEBUG : rclone: Version "v1.59.1" starting with parameters ["rclone" "lsf" "-vvv" "--max-age" "2022-08-17T17:09:00Z" "--absolute" "--transfers" "16" "--no-gzip-encoding" "--ignore-checksum" "--rc" "--rc-no-auth" "--use-mmap" "--s3-memory-pool-use-mmap" "aws:tarteel-session-data/sessions"]
2022/08/17 18:18:41 NOTICE: Serving remote control on http://localhost:5572/
2022/08/17 18:18:41 DEBUG : Creating backend with remote "aws:tarteel-session-data/sessions"
2022/08/17 18:18:41 DEBUG : Using config file from "/home/ubuntu/.config/rclone/rclone.conf"
2022/08/17 18:18:41 DEBUG : aws: detected overridden config - adding "{CDlB7}" suffix to name
2022/08/17 18:18:42 DEBUG : fs cache: renaming cache item "aws:tarteel-session-data/sessions" to be canonical "aws{CDlB7}:tarteel-session-data/sessions"
Here's a profile of what's going on:
github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil.XMLToStruct
and github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil.(*XMLNode).findNamespaces
are the two nodes with consistently increasing memory usage.
My machine has 32GB of RAM and I always kill the command before it runs out of memory.
I can see there's a lot of downloading going on via btop
and occasional CPU spikes (which is when I think the GC runs, but not effect on memory).
go tool pprof -text http://127.0.0.1:5572/debug/pprof/heap
Fetching profile over HTTP from http://127.0.0.1:5572/debug/pprof/heap
Saved profile in /home/ubuntu/pprof/pprof.rclone.alloc_objects.alloc_space.inuse_objects.inuse_space.031.pb.gz
File: rclone
Type: inuse_space
Time: Aug 17, 2022 at 6:10pm (UTC)
Showing nodes accounting for 8985.20MB, 99.79% of 9004.31MB total
Dropped 100 nodes (cum <= 45.02MB)
flat flat% sum% cum cum%
6134.86MB 68.13% 68.13% 8350.46MB 92.74% github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil.XMLToStruct
1872.59MB 20.80% 88.93% 1872.59MB 20.80% github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil.(*XMLNode).findNamespaces (inline)
570.08MB 6.33% 95.26% 570.08MB 6.33% github.com/rclone/rclone/backend/s3.(*Fs).newObjectWithInfo
253.50MB 2.82% 98.08% 253.50MB 2.82% encoding/xml.(*Decoder).name
68MB 0.76% 98.83% 68MB 0.76% encoding/xml.CharData.Copy (inline)
64.66MB 0.72% 99.55% 634.74MB 7.05% github.com/rclone/rclone/backend/s3.(*Fs).listDir.func1
12.50MB 0.14% 99.69% 266MB 2.95% encoding/xml.(*Decoder).rawToken
9MB 0.1% 99.79% 275MB 3.05% encoding/xml.(*Decoder).Token
0 0% 99.79% 253.50MB 2.82% encoding/xml.(*Decoder).nsname
0 0% 99.79% 8358.46MB 92.83% github.com/aws/aws-sdk-go/aws/request.(*HandlerList).Run
0 0% 99.79% 8358.46MB 92.83% github.com/aws/aws-sdk-go/aws/request.(*Request).Send
0 0% 99.79% 8358.46MB 92.83% github.com/aws/aws-sdk-go/aws/request.(*Request).sendRequest
0 0% 99.79% 8358.46MB 92.83% github.com/aws/aws-sdk-go/private/protocol/restxml.Unmarshal
0 0% 99.79% 8358.46MB 92.83% github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil.UnmarshalXML
0 0% 99.79% 8358.96MB 92.83% github.com/aws/aws-sdk-go/service/s3.(*S3).ListObjectsV2WithContext
0 0% 99.79% 8995.20MB 99.90% github.com/rclone/rclone/backend/s3.(*Fs).List
0 0% 99.79% 570.08MB 6.33% github.com/rclone/rclone/backend/s3.(*Fs).itemToDirEntry
0 0% 99.79% 8995.20MB 99.90% github.com/rclone/rclone/backend/s3.(*Fs).list
0 0% 99.79% 8358.96MB 92.83% github.com/rclone/rclone/backend/s3.(*Fs).list.func1
0 0% 99.79% 8995.20MB 99.90% github.com/rclone/rclone/backend/s3.(*Fs).listDir
0 0% 99.79% 8358.96MB 92.83% github.com/rclone/rclone/fs.pacerInvoker
0 0% 99.79% 8995.20MB 99.90% github.com/rclone/rclone/fs/list.DirSorted
0 0% 99.79% 8995.20MB 99.90% github.com/rclone/rclone/fs/walk.walk.func2
0 0% 99.79% 8358.96MB 92.83% github.com/rclone/rclone/lib/pacer.(*Pacer).Call
0 0% 99.79% 8358.96MB 92.83% github.com/rclone/rclone/lib/pacer.(*Pacer).call
I was hoping rclone would come to the rescue for my transfer but looks like I'm gonna have to resort to just writing my own script or something...