Php-fpm hangs when playing large video files

Nextcloud version (eg, 18.0.2): 18.0.3
Operating system and version (eg, Ubuntu 20.04): Ubuntu 18.04
Apache or nginx version (eg, Apache 2.4.25): Nginx 1.17.9
PHP version (eg, 7.1): php-fpm 7.2

The issue you are facing: When playing a large mp4/mov/etc., php-fpm hangs (with 10 or so children) with 50% io wait. Video then buffers when skipping/normal playback. However, when downloading the file, it will saturate a 1 gbit line without much/any io wait.

When closing the video, php-fpm continues to hang for about 30 seconds (rendering Nextcloud unusable). This will happen on both SSD and HDD.

Is this the first time you’ve seen this error? (Y/N): Nope, always been this way.

Steps to replicate it: playing a 1gb+ video regardless of format.

I know a few people were having this issue, of which went largely unsolved. Any ideas? Suggestions? Thanks!

Same occurs when using nextcloud snap, which internally also uses php fpm. What I can observe is even more extreme: If you try to jump forward in the video while playing large (and sometimes even small) videos, it can reliably “crash” my mounted hard drive. And by crash I mean the whole /data directory simply vanishes. Once I reboot the server, the dir is back again with all the files still intact.

This does not seem to be an issue with the drive or the OS, as opening and playing the video directly from the hard drive works fine. Also starting a web server and then streaming the video works fine.

There seem to be some serious IO errors being caused by nextcloud trying to stream video content to the browser (or any client).

I have the same issue using docker (Linux server image)

I also always had this same issue. Been using Nextcloud since 2016. First on an x86 linux machine, and now on Arm RPi 4 for the last couple of years. I switched to using Nginx a couple of years ago because I had heard that it was less resource heavy than Apache primarily due to this issue, however it still remains. I’ve always held hope that a PHP or Python or Nginx update might eventually resolve this, but alas it remains.


i have the same problem. There are any new information about this problem?