Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High memory usage when writing files to mount #329

Open
sb10 opened this issue Jul 2, 2020 · 0 comments
Open

High memory usage when writing files to mount #329

sb10 opened this issue Jul 2, 2020 · 0 comments
Labels

Comments

@sb10
Copy link
Member

sb10 commented Jul 2, 2020

There is high memory usage when writing files to S3 via muxfys mount.

make -f buildscripts/lint.makefile test
make -f buildscripts/lint.makefile race
go test -p 1 -tags netgo --count 1 ./... -v
CGO_ENABLED=1 go test -tags netgo . -v -race -run TestS3L

dd if=/dev/urandom of=/tmp/1G.file bs=1048576 count=1000

s3cmd rm -r s3://sb10/irods_test

wr manager start
perl -e 'for(1..1000){$n++; print "echo $_ && touch s3/touch && cp -fRL /tmp/1G.file s3/\n"}' | wr add -i memleak -r 0 --disk 1 -m 5G -o 2 --mount_json '[{"Mount":"s3","Targets":[{"Path":"sb10/irods_test","Write":true}]}]'
top -u ubuntu
wr manager stop
s3cmd rm -r s3://sb10/irods_test

Using muxfys v4:
Steady at 8.2%. At least the leak is fixed, but I don't like that it uses this memory, presumably dependent on how much data was read or written. Should still look at if this can be fixed.

In a test, uploading a large file immediately jumps from 70MB usage to 728MB and then doesn't change, with allocations going from 641MB and increasing every few seconds by 2MB or so, but also sometimes dropping.

I'm using https://golang.org/pkg/io/#Pipe which is a "synchronous in-memory pipe ... The data is copied directly from the Write to the corresponding Read (or Reads); there is no internal buffering."

So not an obvious buffer problem. Could just be related to the amount of data that is sent in or read out in one go? See what happens with files smaller and larger than ~700MB...

I believe that less memory is used for a cached mount. Check that as well.

@sb10 sb10 added the bug label Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant