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

Long duration recordings #17

Open
rajatbarman opened this issue Oct 11, 2019 · 6 comments
Open

Long duration recordings #17

rajatbarman opened this issue Oct 11, 2019 · 6 comments

Comments

@rajatbarman
Copy link

Hey,

My use case is to record a url where a video conference meeting is happening for more than an hour. There could be >30 meetings happening concurrently.
There is a cron job which runs at 11AM daily, which fetches the scheduled meetings for today and spawns instances of export.js when the meeting starts.
Some recordings do happen successfully but most of them emits one of the following errors -

Error: Protocol error (Runtime.callFunctionOn): Session closed. Most likely the page has been closed.
Error: Page crashed!
Error: Protocol error (Runtime.callFunctionOn): Target closed.

My guess was that the recording video chunks are kept in browser memory (in background.js) and then on stop they are written to disk, and if the video file is large the process runs out of memory, so I tried running node export.js script with --max-old-space-size=2048 but still the same errors. Does the puppeteer browser run out of memory? How to increase the limit for that? I saw the CPU usage of machine, it is well under limit.

Also this might not be the appropriate place to ask this, but I am desperate to get an answer.

@MJunaidAhmad
Copy link

MJunaidAhmad commented Oct 11, 2019

Can you please tell me your server RAM size?

@rajatbarman
Copy link
Author

rajatbarman commented Oct 11, 2019

70GB, I feel the machine is well resourced, its the processes that are not able to utilise the resources. Also, I see .crdownload files in Downloads folder, which indicates chrome was downloading the recorded blob and it crashed or something in between and the download couldn't complete.

Is --disable-dev-shm-usage flag useful?

@muralikg
Copy link
Owner

muralikg commented Oct 11, 2019

Does it crash after same duration everytime or after same size of exported video? That could indicate that the process could be running out of space. If that is the case you could simply write to multiple files and then concatenate the files after the recorder stops.

@muralikg
Copy link
Owner

Also check if /dev/shm has limited space. With limited space in /dev/shm --disable-dev-shm-usage might be helpful

@rajatbarman
Copy link
Author

Thanks for the quick responses, will try with --disable-dev-shm-usage flag.

I couldn't see any pattern of time during crashes, sometimes it crashes in the middle of the recording, sometimes after it is done and the file is being written to disk.

@rajatbarman
Copy link
Author

This is test-schedule.js
https://gist.github.com/rajatbarman/43510e987040c763c3c22d45c13aa0c6

This is test.js
https://gist.github.com/rajatbarman/f5587a9cf1a43199eeb6a519d85201dd

Then I do pm2 start test-schedule.js and getting those errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants