Open
Description
New Issue Checklist
- I am not disclosing a vulnerability.I am not just asking a question.I have searched through existing issues.I can reproduce the issue with the latest version of Parse Server.
Issue Description
When I use FSAdapter and try to fetch multiple files using Parse.File.url({forceSecure: true})
, I`m facing growing of RAM consumption up to 2-2.5 times on my server
Steps to reproduce
The simplest way to reproduce:
- Start express app with ParseServer
- Check up RAM consumption as baseline
- Record the OGG audio file, upload it using Parse to the server
- Start playing in
<audio>
element in html or any other stream player - Check up RAM consumption - level 1
- Stop playing and destruct player to free up link
- Check up RAM consumption - level 2
Actual Outcome
RAM consumption: baseline < level 1 <= level 2. In my case level 2 = level 1 = 2.5x baseline
Expected Outcome
RAM consumption: baseline < level 1 > level 2. I'd like to have 1.5x level 2 = level 1 = 1.5x baseline
Environment
Server
- Parse Server version:
5.5.3
- Operating system:
Ubuntu 20.04
- Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
Local
Database
- System (MongoDB or Postgres):
MongoDB
- Database version:
6.0.3
- Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
Local
Client
- SDK (iOS, Android, JavaScript, PHP, Unity, etc):
JavaScript
- SDK version:
4.1.0
Logs
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
parse-github-assistant commentedon Jul 13, 2023
Thanks for opening this issue!
mtrezza commentedon Jul 13, 2023
If you try to get the file using a CURL request to the REST API, do you see the same increase in RAM consumption?
Kutikov commentedon Jul 14, 2023
No differences between ParseClientJS and access through raw URL
My actions:
audio/ogg codec opus
andvideo/mp4
Results:
125% baseline = level 1 = level 2 for
video/mp4
150% baseline = level 1 = level 2 for
audio/ogg codec opus
Notes:
I'm delighted with these results because RAM consumption is not growing as dramatically as before. I've made some server optimization: I enabled swap file 1Gb and cannot reproduce server freeze and Out of Memory problems after this. I start this investigation because of server crashes and freezes every 5-8 hours. In fact my problem is solved.
Even if we cannot figure out the causes of this RAM consumption growth, it's needed to make a mark in server requirements about at least 1024 MB of RAM combined with 1024 MB of swap for ParseFile using
mtrezza commentedon Jul 14, 2023
I'm not sure what specific number should be added to the docs regarding server requirements. I think this depends on the (virtual) hardware, maybe OS limit settings and the file itself. Maybe there's more to it and file handling could be improved to use the available RAM (with longer response time) instead of crashing the server, but that would require a deeper analysis.
Kutikov commentedon Jul 14, 2023
Ok, so I think this issue is not urgent and can be queued to the regular workflow. Let me know if you need any details or testing. Thank you!