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

Disable nginx buffering for file downloads #29400

Merged
merged 2 commits into from
Nov 2, 2017

Conversation

jvillafanez
Copy link
Member

Description

nginx buffering seems to be causing memory problems while a big file download is happening (big file upload hasn't been checked). The memory usage of the nginx process (not the php-fpm) keeps growing which might crash the server at some point depending on the file size and the memory available in the server.

Note that this behaviour isn't present in apache or in nginx without buffering the response

Related Issue

#29328

Motivation and Context

This solution should disable the nginx buffering only for file downloads. The rest of the operation should behave normally depending on the specific nginx configuration.
While modifying the nginx configuration should be possible, it might be complex to disable just the buffering for file downloads, so you might disable the it for the whole server or for a specific location context.

How Has This Been Tested?

Tested manually with a 4.4GB file (check #29328 (comment) for set up)

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@DeepDiver1975 @PVince81 To be decided if this will be the solution. Not happy to include server-specific code but it's probably the easiest solution.

@mmattel
Copy link
Contributor

mmattel commented Oct 31, 2017

@PVince81 @jvillafanez
👍
Approved, works, see #29328 (comment)
Please restart the check.
I propose backporting.
Thanks a lot !

@jvillafanez
Copy link
Member Author

Backport to stable10 in #29403

@codecov
Copy link

codecov bot commented Oct 31, 2017

Codecov Report

Merging #29400 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #29400      +/-   ##
============================================
+ Coverage     60.51%   60.51%   +<.01%     
  Complexity    17193    17193              
============================================
  Files          1031     1031              
  Lines         57288    57289       +1     
============================================
+ Hits          34667    34668       +1     
  Misses        22621    22621
Impacted Files Coverage Δ Complexity Δ
apps/dav/lib/Connector/Sabre/FilesPlugin.php 85.81% <100%> (+0.09%) 45 <0> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 64f5ad5...9a3f4c4. Read the comment docs.

@DeepDiver1975 DeepDiver1975 self-requested a review November 2, 2017 12:02
Copy link
Member

@DeepDiver1975 DeepDiver1975 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Squash please - otherwise 👍

Copy link
Contributor

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@PVince81 PVince81 merged commit 5a1177a into master Nov 2, 2017
@PVince81 PVince81 deleted the disable_nginx_buffering_on_downloads branch November 2, 2017 15:17
@jvillafanez jvillafanez restored the disable_nginx_buffering_on_downloads branch November 6, 2017 07:50
@jvillafanez jvillafanez deleted the disable_nginx_buffering_on_downloads branch November 6, 2017 07:52
@PVince81 PVince81 mentioned this pull request Nov 30, 2017
87 tasks
@lock
Copy link

lock bot commented Aug 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants