Skip to content

External storage keep session between calls for WebDAV and others #11815

Closed

Description

@PVince81

When mounting a WebDAV / ownCloud external storage, CURL is used but the session is never kept, possibly causing additional overhead.

We should look into keeping the CURL HTTP session in the PHP session somehow.
One idea would be to store the session cookie returned by the first CURL call.

This is especially important to improve the performance for server to server sharing.

@icewind1991 @bantu do you think this could help ?

CC @dragotin @guruz

Activity

  1. guruz commented on Oct 28, 2014

    @guruz
    Contributor

    (Impl. detail: Any reason to use the cookies from the first call and not the cookies from all / last call?
    Then you'd also catch cases where the cookies timeout (or similar) and you'd re-auth (HTTP 401) and get new cookies.)

  2. PVince81 commented on Oct 28, 2014

    @PVince81
    ContributorAuthor

    From what I see there are actually two mechanisms:

    1. FS operations: Sabre Client: I haven't looked into the details but I'd expect it to somehow keep the session, at least within the same PHP call. I believe that it also uses curl
    2. Uploads/downloads/fopen: direct curl calls (the file is downloaded locally in a temp file to allow random access)

    Maybe there's a way to consolidate these and/or to make the curl session cookie survive between PHP calls.

  3. dragotin commented on Oct 28, 2014

    @dragotin
    Contributor

    Wouldn't setting an Auth-Header for every call solve the problem for now?

    I don't think it would have to be the full session. With the auth header the server would still have to verify the credentials (with the negative impact if for example LDAP Auth.) but it does that now as well. But with Auth-Header it would be half the requests.

  4. guruz commented on Oct 28, 2014

    @guruz
    Contributor
    1. FS operations: Sabre Client: I haven't looked into the details but I'd expect it to somehow keep the session, at least within the same PHP call. I believe that it also uses curl

    This is where we could achieve double performance for the update phase of a sync run. (assuming that a unauthed request and an authed response take the same time and not taking into account how the file scanner might pre-cache some info)

    1. Uploads/downloads/fopen: direct curl calls (the file is downloaded locally in a temp file to allow random access)

    Two comments I got to this one:

    • A local download is not good since it leads to a possible timeout for the syncing client since the server does not send anything in the meanwhile to the sync client. It also doesn't efficiently use the bandwidth then. @ogoffart and @guruz have implemented a streaming solution for one customer-specific backend. Contact us if you want to know more.
    • The sync client also supports a special feature called directDownloadUrl (dDU webdav propery). With that, the client could directly go to the mounted instance (without going through the middleman instance). I understand that this is not possible/desired in all situations though (firewalls, abstractions, information hiding etc)
  5. PVince81 commented on Oct 28, 2014

    @PVince81
    ContributorAuthor

    Note: streaming download might be achievable for WebDAV at least (but not all backends would support this). I believe there's a PR from someone that already provides this: #10620

  6. added this to the backlog milestone on Aug 21, 2015
  7. PVince81 commented on Oct 10, 2016

    @PVince81
    ContributorAuthor

    The PR that adds the Auth header was closed because it broke stuff: #11826

    The proposed extended approach is described here: #11826 (comment)

  8. PVince81 commented on Oct 10, 2016

    @PVince81
    ContributorAuthor

    Auth header is already passed as I've observed in #12228.

  9. lock commented on Aug 3, 2019

    @lock

    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.

  10. locked as resolved and limited conversation to collaborators on Aug 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions