Downloading large file via web-ui - nginx memory leak

Nextcloud version: 18.0.4
Operating system and version: Ubuntu 18.04
Nginx version: 1.14.0
PHP version: 7.2

The issue you are facing:
Can’t download big folder (46,8Gb) with about 50 files (video) via web-ui. Downloading process of a zip file starts then it almost finishes and then downloading starts again from zero.
After the second finish I’ve got downloading indicator with “0 B/s - 0 B” in browser’s downloads list and after that “download error”.

I’m in LAN with my server. Browser - yandex browser. Got no errors

Is this the first time you’ve seen this error? (Y/N): N.

Steps to replicate it:

  1. Try to download big folder via web-ui.

The output of your Nextcloud log in Admin > Logging:

no messages in nextcloud log at time when error appears

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

Support intro
$CONFIG = array (
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' =>
  array (
    0 => '',
    1 => '',
  'datadirectory' => '/mnt/data/www/',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => '',
  'dbname' => 'fqdn',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'fqdn',
  'dbpassword' => '',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'mysql.utf8mb4' => true,
  'maintenance' => false,
  'default_language' => 'ru',
  'default_locale' => 'ru_RU',
  'allow_user_to_change_display_name' => true,
  '' => true,
  'logtimezone' => 'Europe/Moscow',
  'log_type' => 'owncloud',
  'logfile' => '/var/log/fqdn.log',
  'loglevel' => '2',
  'log_rotate_size' => '104857600',
The output of your Apache/nginx/system log in `/var/log/____`:

no messages in nextcloud log at time when error appears

After above is done I’ve got nginx memory leak. It eats 85% of my server’s 4Gb ram. First time server stopped responding to ssh connections. Second time restarting nginx service helped.

Figured out with total unresponsibility of server. Dropped down to earth inadequate values of php children and set up max memory consumption.

But download is not working. Zip file fully downloaded with it’s size of 46,8Gb but not finished. The speed of downloading drop to zero and in half a minute download starts again from a beginning.

I cancelled downloading and made a screenshot right after. The values aren’t freezing. They are changing actively.2020-05-22_19-57-43

For now php has finished his tasks and only nginx stays up with 86% of ram and still growing…

Any ideas to solve it?

p.s. My folder downloads great with desktop app. But sometimes it is more comfortably to do my things directly via web.

In my case, there was a problem with the nginx syntax.
fastcgi_buffers 64 4K
When I removed the syntax, there was no memory leak.