mountpoint-s3: mountpoint-s3 has a high memory usage, resulting in an Out of memory: Kill process error in the analysis software diamond

Mountpoint for Amazon S3 version

mount-s3 v1.0.2

AWS Region

cn-northwest-1

Describe the running environment

Running in EC2(c6i.4xlarge) on Centos7 against an S3 Bucket in the same account.

What happened?

My testing scenario is using diamond blast for genomics analysis, the command used are as follows:

docker run -v /data:/data 
-v /database:/data/db/RD/Metagenome/database \
--privileged --log-opt max-size=10m --log-opt max-file=3 \
dockerimage diamond blastp --threads 16 -b 3 -q /data/gene_catalogue.faa.${index} \
-d /data/db/RD/Metagenome/database/nr.dmnd -o /data/Unigenes_vs_nr_blt.txt.${index} \
--max-target-seqs 10 --evalue 0.0001 --outfmt 6 qseqid qlen sseqid stitle slen \
pident length mismatch gapopen qstart qend sstart send evalue bitscore

Among them, nr.dmnd is the reference database that the analysis relies on, stored in the S3 bucket. The S3 bucket is mounted to the /database directory on EC2 with mount-s3.

One EC2 runs one task to process one sample, each task needs to run for approximately 6 hours. I simultaneously started 20 EC2 runs 20 tasks (index from 1 to 20). Among the 20 tasks, 2-3 out of 20 tasks often fail after running for over about 5 hours, and the task index that fail each time are not fixed. The following error message is observed:

Oct 11 15:28:26 ip-10-0-0-13 kernel: Out of memory: Kill process 3484 (diamond) score 750 or sacrifice child
Oct 11 15:28:27 ip-10-0-0-13 kernel: Out of memory: Kill process 3722 (diamond) score 750 or sacrifice child

Then I replaced mount-s3 with goofys, and all 20 tasks were successful every time, but the analysis time will be about 8% -10% longer than using mount-s3.

I suspect that this issue is caused by the high memory usage of mount s3. I am not sure if you have any suggestions or if you can optimize the memory usage of mount s3 in the future?

Relevant log output

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 15 (9 by maintainers)

Commits related to this issue

Most upvoted comments

In the last release (v1.3.2), we released a change (6e7252d) which fixed a potential memory leak due to unreleased file handles. This leak was reported in #670, and you may have been impacted if you saw lots of messages in the logs like “mountpoint_s3::fuse: release failed: unable to unwrap file handle reference”. I’ll share this in that particular issue so folks can try it out too.

I do recall seeing that message earlier in one of our test envs late last year (running an earlier version though I don’t recall which one), but I didn’t have time then to capture logs and look into it. I definitely did not see that when I was trying to reproduce this most recently.

Anyway, sorry to hijack @sunl’s issue, I thought I was hitting the same bug. I’ll shut up now 😉

Update: we can no longer reproduce this leak behavior using the latest release.

As we run the scan, we see memory usage creep upwards, but at the end of the scan it’s on the order of 100MB used. That usage doesn’t go away until we unmount, but it doesn’t go higher than that. In earlier releases, it would climb uncontrolled until the system became unresponsive.

That’s brilliant news, thank you for sharing!

I hope it is broadly applicable, though I doubt it will have solved the issue @sunl is facing. The logs shared show only one file handle hanging around.

In the last release (v1.3.2), we released a change (https://github.com/awslabs/mountpoint-s3/commit/6e7252dd2e54932e277e5b5ee7000f9bc816a682) which fixed a potential memory leak due to unreleased file handles. This leak was reported in #670, and you may have been impacted if you saw lots of messages in the logs like “mountpoint_s3::fuse: release failed: unable to unwrap file handle reference”. I’ll share this in that particular issue so folks can try it out too.

Im experiencing a similar issue.

Running a find command against my mounted bucket causes the memory usage to steadily tick upwards and once the find is killed that memory usage is not released. We are not configuring any of the cache options.

Hey @daltschu22, do you mind opening a new bug report? This sounds like a case that will be easier to reproduce - details of the EC2 instance or machine being used, the number of S3 objects and how they are organized will be useful. The exact find command (redactions OK) would also be great.