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

Video files still being load in background even file isn't viewed anymore #894

Closed
AykutCevik opened this issue May 12, 2021 · 21 comments · Fixed by #1206
Closed

Video files still being load in background even file isn't viewed anymore #894

AykutCevik opened this issue May 12, 2021 · 21 comments · Fixed by #1206
Labels
3. to review Waiting for reviews bug Something isn't working high High priority performances Performances issues and optimisations

Comments

@AykutCevik
Copy link

AykutCevik commented May 12, 2021

Describe the bug
Playing a larger video selected from the file list within the browser, the viewer opens and plays the video. If you now switch to the next file with the arrow keys you can view other images and videos like any other gallery. But until you close the viewer the videos which you went through or viewed shortly are still being load in the background. This happens until you close the viewer totally. If you now to continue to view several videos it adds up and all these files to the download and not only slows down the whole connection but also increases data usage/traffic.

To Reproduce
Steps to reproduce the behavior:

  1. Open nextcloud within your browser and find a folder with several video and image files
  2. Click on any video and it opens in the viewer to play the video
  3. Switch now to another media file, do this several times if needed
  4. See that the previous videos are still being loaded in the background until the whole file is loaded or viwer is closed

Expected behavior
Download of any file should be stopped once the file isn't viewed anymore

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Firefox
  • Version 88
  • NC: 21.0.1
@AykutCevik AykutCevik added 0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working labels May 12, 2021
@AykutCevik AykutCevik changed the title Video files still load in background even viewer is closed Video files still load in background even file isn't viewed anymore May 12, 2021
@AykutCevik AykutCevik changed the title Video files still load in background even file isn't viewed anymore Video files still being loaded in background even file isn't viewed anymore May 12, 2021
@AykutCevik AykutCevik changed the title Video files still being loaded in background even file isn't viewed anymore Video files still being load in background even file isn't viewed anymore May 12, 2021
@skjnldsv

This comment has been minimized.

@skjnldsv skjnldsv marked this as a duplicate of #840 May 18, 2021
@skjnldsv skjnldsv reopened this May 18, 2021
@skjnldsv

This comment has been minimized.

@skjnldsv skjnldsv marked this as not a duplicate of #840 May 18, 2021
@skjnldsv
Copy link
Member

Duplicate of nextcloud/server#8161 maybe?

@AykutCevik
Copy link
Author

@skjnldsv not related since this is an issue within the client as it continues to download. The ticket you have referenced seems to be related to the server which still reads the file.

@skjnldsv
Copy link
Member

Ah, then I was right the first time: #840

@AykutCevik
Copy link
Author

Not sure, your reference is regarding the CPU load, my issue is regarding the network load. Maybe these are related, has to be debugged to find out.

@skjnldsv
Copy link
Member

this.player.pause()

We pause the viewer on prev/next, but we should maybe stop manually the load

@AykutCevik
Copy link
Author

@skjnldsv this makes sense for me, at least if stop will also stop it from downloading the file.

@szaimen
Copy link
Contributor

szaimen commented May 26, 2021

@skjnldsv what happens if you change this.player.pause() to this.player.stop()? Does it stop the video stream correctly?

@skjnldsv
Copy link
Member

No idea, but resuming a previous play is a feature, so we must be careful

@pierreozoux
Copy link
Member

I commented here, but I can give more details:
since I posted the issue, we updated Nc, optimized php, and increased the number of app servers, and it seems the problem is gone.

@zyphlar
Copy link

zyphlar commented Sep 1, 2021

Based on @szaimen 's suggestion I watched a video until the very end (fortunately it didn't take too long to download) and then I was able to delete the file. Attempting to delete a video I had just partially watched, however, failed multiple different ways beforehand. This was especially irritating when trying to prune multiple large videos to recover storage space, since before this advice I had to reload the page every time I wanted to delete what I'd just reviewed. (The lack of thumbnails for my videos is also a problem here.)

@tgrimminger
Copy link

tgrimminger commented Sep 16, 2021

I experience these exact problems with my own nextcloud docker containers.

Problem: very slow stream even locally (no bandwidth concern), very high CPU usage (95-100% while playing video) and extremely high bandwidth usage (saturating the 1Gbit link) between application (nextcloud) server and file server (SMB). This persists about 30s - 1min after attempting to watch a file (MP4, 1-5gb)

What I've tried:

  • mount locally (mounted via cifs on the host os)
  • mount via smb - external storage
  • used Linuxserver.io's image and official
  • used mariadb and postgres

I've made partial progress by using an old nextcloud version 15 container - works as it should, low bandwidth usage, low CPU usage.

Amy idea what could cause this? I can't run nextcloud 15 in production because of security concerns ofc.

@pierreozoux
Copy link
Member

@tgrimminger did you tune php?

@skjnldsv
Copy link
Member

@pierreozoux could you elaborate your php tuning? :)

@pierreozoux
Copy link
Member

@skjnldsv If I recall well, this is this https://lab.libreho.st/libre.sh/docker/nextcloud/-/commit/cc95740eb724233559757035cc3f237e8fbdec98
(nothing fancy, but just the defaults are too low, and my intuition was that reading one video was exhausting the php processes)

But you can see our setup here:
https://lab.libreho.st/libre.sh/docker/nextcloud/-/tree/master/base

@skjnldsv
Copy link
Member

Nice! Thank you! If it make sense, it would benefit others to edit the documentation 😉

@skjnldsv skjnldsv added 1. to develop Accepted and waiting to be taken care of high High priority performances Performances issues and optimisations and removed 0. Needs triage Pending approval or rejection. This issue is pending approval. labels Mar 8, 2022
@MadMakz
Copy link

MadMakz commented Apr 8, 2022

Those PHP configs don't solve the issue but rather "delay" them. Processes won't die if player is closed / moved to next file.

You'll end up with a bunch of zombie processes evntually resulting in a complete unresponsive system.

Recently tested with PHP 8.0. (Untested:) You could probably set max_execution_time to a low value, but that'll affect the timeframe you have for uploads (i think)

Processes shown below remain there without any continued user presence on the frontend. (Except for the fpm-status script ofc)

fpmspam

My guess is that those run untill either max_execution_time or maybe EOF is reached.

@Glide01
Copy link

Glide01 commented Apr 9, 2022

@MadMakz Does this mean that PHP 8.0 is the solution?

@kescherCode
Copy link

@Glide01 no, it merely means the bug is still present.

@skjnldsv skjnldsv added 3. to review Waiting for reviews and removed 1. to develop Accepted and waiting to be taken care of labels Apr 12, 2022
@skjnldsv
Copy link
Member

Should be force requesting the browser to stop loading any background stream
#1206

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug Something isn't working high High priority performances Performances issues and optimisations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants