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

Requesting large ranges in webdav results in poor performance #15321

Closed
dratini0 opened this issue Mar 30, 2015 · 12 comments
Closed

Requesting large ranges in webdav results in poor performance #15321

dratini0 opened this issue Mar 30, 2015 · 12 comments
Assignees
Milestone

Comments

@dratini0
Copy link
Contributor

I was trying to mount a webdav share with GVFS, and then play a 10G video, hoping it would work, and it didn't. Turns out it requested ranges from the file, which OC apparently does not like.

Steps to reproduce

  1. Put a large file on an Owncloud server
  2. Try to request a huge chunk of it using webdav and the HTTP range header. See below for an example.

Expected behaviour

The download should start immediately

Actual behaviour

Owncloud went ahead to create a temporary file equal in size to the requested range, which took about a minute (happens for local files and local shares)

Server configuration

Operating system:
Debian 7.8 amd64
Web server:
nginx 1.6.2-5~bpo70+1
Database:
MySQL 5.5.41-0+wheezy1
PHP version:
PHP 5.4.39-0+deb7u2
ownCloud version: (see ownCloud admin page)
ownCloud 8.0.2-8
Updated from an older ownCloud or fresh install:
Have been rolling since 6.x
List of activated apps:

  • activity
  • calendar
  • contacts
  • documents
  • external
  • files
  • files_external
  • files_pdfviewer
  • files_sharing
  • files_texteditor
  • files_trashbin
  • files_versions
  • files_videoviewer
  • gallery
  • news
  • notes

The content of config/config.php:

<?php
$CONFIG = array (
  'datadirectory' => '/home/oc_data',
  'dbtype' => 'mysql',
  'version' => '8.0.2.0',
  'dbname' => 'owncloud',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'installed' => true,
  'forcessl' => false,
  'loglevel' => '0',
  'log_authfailip' => true,
  'theme' => '',
  'maintenance' => false,
  'mail_smtpmode' => 'php',
  'overwrite.cli.url' => '/owncloud',
);

Are you using external storage, if yes which one: local

Are you using encryption: no

Are you using an external user-backend, if yes which one: none

Client configuration

Browser:
gvfs 1.22.2, netcat 1.105-7

Operating system:
Debian Jessie amd64

A request that jammed my owncloud: (the file is 10704943577 bytes long)

GET /owncloud/remote.php/webdav/10G-Movie.mkv HTTP/1.1
Host: ...
Accept-Encoding: gzip, deflate
Accept-Language: en-us, en;q=0.9, en;q=0.8
Connection: Keep-Alive
Range: bytes=40960-
User-Agent: gvfs/1.22.2
Authorization: Basic ...
Cookie: ...

P. s.: Sorry, I haven't had the opportunity to try in a newer install, but I haven't seen any discussion regarding the issue.

@dratini0
Copy link
Contributor Author

I have found the culprit, it's in upstream sabredav: /lib/DAV/CorePlugin.php, line 178

Apparently it implements ranges by creating a temporary stream and blindly copying. I will attempt to submit a pull request there, and we will see how it goes.

@jospoortvliet
Copy link

#14383 might be helpful for this too.

@PVince81
Copy link
Contributor

@dratini0 are you still seeing this in 8.1.4 or 8.2 which contain an updated Sabre version ?

Did I understand well that you are using external storage with the type "local" ? That one should be seekable, so not sure why the seekable check would return false here. The symptoms you see would usually only be observed on non seekable external storages.

@elvetemedve
Copy link

@PVince81 I've updated Owncloud to version 8.2.1, but CorePlugin.php still contains the temporary stream implementation. So the problem is still there.

@PVince81
Copy link
Contributor

You mean https://github.com/owncloud/3rdparty/blob/stable8.2/sabre/dav/lib/DAV/CorePlugin.php#L177 ?

Yeah, strange. I'll report this upstream.

@PVince81
Copy link
Contributor

Hmm, looks like in Sabre 3 (the next major version) they got rid of the temporary stream https://github.com/fruux/sabre-dav/blob/master/lib/DAV/CorePlugin.php#L175

Here is the ticket for upgrading to Sabre 3: #17039

@evert can you confirm that Sabre 3 will not buffer/copy the whole stream into a temp stream for range requests like Sabre 2 did ?

@evert
Copy link

evert commented Nov 19, 2015

It looks like that never made it into the changelog, but I fixed that now.

We did indeed improve this, in this PR:

https://github.com/fruux/sabre-dav/pull/623

Originally appeared in version 2.2.0-alpha4

@guruz
Copy link
Contributor

guruz commented Nov 19, 2015

Awesome to see this! :)

@evert
Copy link

evert commented Nov 19, 2015

Note that this was 100% by the OP of this ticket, @dratini0

@DeepDiver1975 DeepDiver1975 added this to the 9.0-current milestone Nov 20, 2015
@DeepDiver1975 DeepDiver1975 self-assigned this Nov 20, 2015
@PVince81
Copy link
Contributor

Cool. I see that the fix is available starting with 3.0: https://github.com/fruux/sabre-dav/blob/3.0/lib/DAV/CorePlugin.php#L180

@DeepDiver1975
Copy link
Member

master is now on sabre 3.0 -> closing

@lock
Copy link

lock bot commented Aug 7, 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 7, 2019
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

8 participants