Skip to content

OC_FileChunking on external file systems #4997

Closed

Description

@DeepDiver1975

The current implementation of OC_FileChunking is storing the chunks in the servers file cache (hidden/private folder on the server).

After all chunks have been received the file is reassembled and moved to the final target location.

While this approach seems valid for local filesystems this can case issues with respect to external filesystems and big files, because the final move of assembled file will consume some time.

From the overall system behavior it might be interesting to move the chunks already to the external filesystem.

My suggestion would be to store the chunks already in the target file but name it differently, append the .part and even make it hidden if possible.

This approach would speedup the process on the local filesystem as there is no reassembly step which as of today adds additional execution time.

@karlitschek @bartv2 @icewind1991 @danimo @dragotin
Please add your comments - THX

Activity

  1. dragotin commented on Sep 26, 2013

    @dragotin
    Contributor

    👍 as mentioned in bug #2947 already which was killed by a close-bugs-no-matter-what wave unfortunately ;-)

  2. bartv2 commented on Oct 4, 2013

    @bartv2
    Contributor

    This is a good idea, we only need to add an offset header to know where in the file to write the chunk. This way the order of chunks is not important

  3. DeepDiver1975 commented on Oct 16, 2013

    @DeepDiver1975
    ContributorAuthor

    This is a good idea, we only need to add an offset header to know where in the file to write the chunk. This way the order of chunks is not important

    we could use the http range header for this

  4. DeepDiver1975 commented on Oct 16, 2013

    @DeepDiver1975
    ContributorAuthor

    @karlitschek oc7 I guess 😉

  5. icewind1991 commented on Oct 16, 2013

    @icewind1991
    Contributor

    Assembling the chunks on the external file system will be a problem though most backends don't support partial writes or appends, the only reliable way to append two uploaded chunks on an external file system would be to download both chunks and upload the result.

  6. DeepDiver1975 commented on Oct 16, 2013

    @DeepDiver1975
    ContributorAuthor

    In such a scenario we need to stick with the approach we have today.

    What about moving this to the storage api and let the storage implementation handle this? 

  7. karlitschek commented on Oct 17, 2013

    @karlitschek
    Contributor

    Yes. ownCloud 7

  8. icewind1991 commented on Oct 17, 2013

    @icewind1991
    Contributor

    Moving it to the storage API might help but I only know of one backend (ftp) that might be able to provide a better then default implementation.
    so I don't think it will help much in the end.

  9. DeepDiver1975 commented on Oct 17, 2013

    @DeepDiver1975
    ContributorAuthor

    it will help with irods as well - not the most common storage but still ..... 😉

  10. PVince81 commented on May 2, 2014

    @PVince81
    Contributor

    Any more ideas on this ? After reading the thread that raises some relevant issues about the proposed approaches, I can't think of any other at the moment.

  11. PVince81 commented on May 2, 2014

    @PVince81
    Contributor

    I heard that 1.6.0 has configurable chunk sizes. If we can increase the chunk size to reach the max upload size, it might help when uploading files to ext storage as a single chunk, at least for bigger files.
    This way the sysadmin, if they wish so, could manually increase the max upload size to bigger values to match the kind of file sizes expected in their environment.

  12. dragotin commented on May 5, 2014

    @dragotin
    Contributor

    @PVince81 remember that we also introduced the chunking to not get hit by the request timeout.

  13. DeepDiver1975 commented on May 5, 2014

    @DeepDiver1975
    ContributorAuthor

    I heard that 1.6.0 has configurable chunk sizes.

    We might want to update the protocol in this case - I can think scenarios where the chunk size can become an necessary information on the server. As of today the chunk size is not communicated.

    @dragotin another topic for Wednesday?

  14. dragotin commented on May 5, 2014

    @dragotin
    Contributor

    Yes, but I do not really see a big benefit in changing/configuring the chunk size.

  15. added this to the milestone on Sep 2, 2014
  16. 41 remaining items

  17. VincentvgNn commented on Feb 13, 2015

    @VincentvgNn

    @PVince81
    Thanks for your response.
    Where can I find that php-fpm or mod_php setting? Within the OC server settings (as downloaded and set by the auto-installer) or outside?
    I just tried phpinfo.php and found PHP-version 5.5.21 and a lot more, but nothing about these settings. And above, I would not be able to change something there.

    Shouldn't a killed process be able to recover by using the available "chunking" files?
    As it is now the cashed files seem to stay forever.

  18. PVince81 commented on Feb 13, 2015

    @PVince81
    Contributor

    @VincentvgNn it's not a setting it's your setup. phpinfo might tell you.

    If the chunk files aren't complete there is no way to recover them. The client should then resend the chunk again, with a different transaction id (@dragotin can you confirm?). This would leave canceled chunks lying around, which is a known issue.

  19. VincentvgNn commented on Feb 13, 2015

    @VincentvgNn

    @PVince81
    php-fpm was introduced from PHP 5.3.3 onwards. So I bet that I have php-fpm and and no more mod_php. Phpinfo mentions the authors for CGI / FastCGI and FastCGI Process Manager, but nothing about php-fpm or mod_php.
    I seem to experience auto-kill for PHP processes at a broken connection.

  20. modified the milestones: , on Mar 2, 2015
  21. VincentvgNn commented on Mar 23, 2015

    @VincentvgNn

    @PVince81
    On Feb. 13th you confirmed that chunks lying around is a known issue.
    Today I tested server 8.0.2 and client 1.8.0. There was a moment where the file transfer ran very slow resulting in quite some interrupts and producing many chunks. The chunks occupied more space than the good files!
    Is anyone working on solving the problem of chunks that should be automatically removed after some time?

  22. PVince81 commented on Mar 23, 2015

    @PVince81
    Contributor

    The chunk cleanup will be a background job starting with 8.1: #14500

  23. PVince81 commented on Sep 21, 2015

    @PVince81
    Contributor

    We're past feature freeze => 9.0.

  24. modified the milestones: , on Sep 21, 2015
  25. DeepDiver1975 commented on Nov 10, 2015

    @DeepDiver1975
    ContributorAuthor

    closing this in favor of #20118

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions