Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

Scrubbing through large video file keeps many PHP processes running, locks up server #44

Open
abaart opened this issue Oct 27, 2017 · 7 comments

Comments

@abaart
Copy link

abaart commented Oct 27, 2017

When you scrub through a large video file (in my case 6+ hrs, 70+GB), there are PHP processes that keep running on the server. Each process keeps reading out the file at a significant speed. However, new PHP processes are spawned on every change of position in the file. As the file is very large these processes keep running for a very long time.
When i download the file and stop the download while in progress, there are no PHP processes that are running after stopping. Does the video player close the connection properly when seeking through the file?
I am running Nextcloud on nginx with php-fpm 7.0.

Expected behaviour

Seeking/scrubbing a video file should not spawn (additional) PHP processes that keep running for a long time.

Actual behaviour

On every scrub/seek additional PHP processes are spawned, until the server-set maximum of processes is reached and the server becomes unresponsive.

Steps to reproduce

  1. Put large video file in Nextcloud.
  2. Play back file in browser.
  3. Open top/htop on server
  4. Seek through file several times
  5. Watch many PHP processes/workers run for a long time.
    (6. Keep seeking, server will become unresponsive as max. workers are running)
@Instagit
Copy link

Instagit commented Nov 1, 2017

Thanks for the report. I would guess that custom video players have a different scrubbing behavior compared to the browser's default HTML5 video player, so this could be an upstream problem. I'll look into it when I got some time.

@abaart
Copy link
Author

abaart commented Nov 1, 2017

Thanks! I'm also not sure whether the cause of this problem is in the video player or in Nextcloud itself. For now I just disabled the videoplayer. This problem is also enabled by the very long timeout configured in PHP. On normal settings a runaway process will be terminated after 30 seconds or so. However, this causes problems when users download large files that take a long time to finish downloading.

@ghost
Copy link

ghost commented May 3, 2018

I have the same problem. The Server locks up and ends with a 502 bad gateway error

@Instagit
Copy link

Instagit commented May 4, 2018

Ok, I need to call in the server team here. 😄 I created a 93 GB test video file (concatenate the same video 100 times with ffmpeg) and tried to upload it. The upload never finished, but now I have 93 GB of file parts sitting in the uploads directory that can't be accessed from the Nextcloud UI. There seems to be a general problem with handling large files.

@nextcloud/server-triage

@MorrisJobke
Copy link
Member

The upload never finished, but now I have 93 GB of file parts sitting in the uploads directory that can't be accessed from the Nextcloud UI. There seems to be a general problem with handling large files.

This is cleaned up once on every login - see nextcloud/server#8759

For the failed upload: please open a ticket in server with steps how to reproduce and potential logs.

@fherbin
Copy link

fherbin commented Sep 2, 2019

hello, same problem form me, when i seek more than 2 times on a 3Go video File, php die
there is some investigation about this issue ?

just to motivate the devs: improve the video playback will allow you to win a large audience who use youtube / plex / emby etc...

@clawoflight
Copy link

Any news? 1.5 GB seems to be enough, which makes the player pretty much unusable for any kind of phone video.

@Revvz
Copy link

Revvz commented Oct 22, 2019

I have the same problem. I already broke my head, I thought I had a problem with the server settings. But it turns out this is a common misfortune.
When I play a video, I have www pool, and it is impossible to close them in any way except to close the video.
I set a timeout of less than 120 seconds. At least php-fpm processes stop after this time, and earlier even after closing the file they continued to execute the video script.
even turning off the video player in nextcloud does not help me, the files are still played.

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

No branches or pull requests

7 participants