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

Make chunk cache ttl configurable #23455

Closed
fkammer opened this issue Mar 21, 2016 · 5 comments
Closed

Make chunk cache ttl configurable #23455

fkammer opened this issue Mar 21, 2016 · 5 comments

Comments

@fkammer
Copy link
Contributor

fkammer commented Mar 21, 2016

Steps to reproduce

  1. Start uploading a very large file (e.g. 10 GB) via owncloud client
  2. Use uploading computer as usual (let it go to sleep, shut it down over night, don't have an internet connection all the time)

Expected behaviour

  • ocClient starts to upload the large file in 5MB chunks.
  • It pauses once in a while (no connection, computer goes to sleep or is shut down).
  • It resumes uploading after the connection is established again
  • Upload finishes after all chunks are uploaded

Actual behaviour

  • ocClient starts to upload the large file in 5MB chunks.
  • It pauses once in a while (no connection, computer goes to sleep or is shut down).
  • It resumes uploading after the connection is established again
  • Chunks older than one day are removed by the Garbage Collection
  • ocClient detects that a good amount of chunks is missing (as they were deleted by GC)
  • Starts to upload these chunks again
  • During that, other now outdated chunks are deleted

Problem: The upload takes forever as the client is not able to upload all chunks in 24 hours.

Fix

You can fix that behaviour by increasing the default ttl in https://github.com/owncloud/core/blob/master/lib/private/cache/file.php#L114 to a greater value.

It would be nice if this value could be configurable via the config file. As I have more than enough disc space left it would be no problem to increase it to multiple days or a week (I hardcoded it now).

Server configuration

Operating system:
Debian 8.3 amd64
Web server:
Server version: Apache/2.4.10 (Debian)
Server built: Nov 28 2015 14:05:48
Database:
mysql Ver 14.14 Distrib 5.5.47
PHP version:
PHP 5.6.17-0+deb8u1 (cli) (built: Jan 13 2016 09:10:12)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
ownCloud version: (see ownCloud admin page)
ownCloud 9.0.0 (stable)
Updated from an older ownCloud or fresh install:
Updated from multiple older ownCloud versions
Where did you install ownCloud from:
Linux distribution packages (from Open Build Service)
Signing status (ownCloud 9.0 and above):
No errors have been found.
List of activated apps:

Enabled:
  - activity: 2.2.1
  - announcementcenter: 1.1.1
  - calendar: 1.0
  - comments: 0.2
  - contacts: 1.0.0.0
  - dav: 0.1.5
  - documents: 0.12.0
  - encryption: 1.2.0
  - federatedfilesharing: 0.1.0
  - federation: 0.0.4
  - files: 1.4.4
  - files_pdfviewer: 0.8
  - files_sharing: 0.9.1
  - files_texteditor: 2.1
  - files_trashbin: 0.8.0
  - files_versions: 1.2.0
  - files_videoplayer: 0.9.8
  - firstrunwizard: 1.1
  - gallery: 14.5.0
  - notifications: 0.2.3
  - provisioning_api: 0.4.1
  - systemtags: 0.2
  - templateeditor: 0.1
  - updatenotification: 0.1.0
Disabled:
  - external
  - files_external
  - search_lucene
  - user_external
  - user_ldap

The content of config/config.php:

{
    "system": {
        "instanceid": "oc22d9880cdf",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "owncloud.osnaware.de"
        ],
        "datadirectory": "\/var\/www\/owncloud\/data",
        "overwrite.cli.url": "http:\/\/owncloud.osnaware.de",
        "dbtype": "mysql",
        "version": "9.0.0.19",
        "dbname": "owncloud",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "forcessl": true,
        "mail_smtpmode": "smtp",
        "mail_from_address": "owncloud",
        "mail_domain": "osnaware.de",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_smtphost": "mail.osnaware.de",
        "mail_smtpport": "587",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "loglevel": 4,
        "mail_smtpsecure": "tls",
        "theme": "",
        "maintenance": false,
        "forceSSLforSubdomains": true,
        "singleuser": false,
        "updatechecker": false,
        "trashbin_retention_obligation": "auto"
    }
}

Are you using external storage, if yes which one: local/smb/sftp/...
no
Are you using encryption: yes/no
no
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
no

Client configuration

Browser:
ownCloud Client – Version 2.1.1 (build 3107)
Operating system:
OS X El Capitan (10.11.3)

@PVince81
Copy link
Contributor

@fkammer if you'd like to have a try providing a proper fix, you can use \OC::$server->getConfig()->getSystemValue($key, $default) to access values from config.php.

@fkammer
Copy link
Contributor Author

fkammer commented Mar 22, 2016

@PVince81 I'd be glad too. What do you think about gc_ttl as name for the key?

@PVince81
Copy link
Contributor

'cache_folder_gc_ttl` maybe. Make sure that config.sample.php is adjusted accordingly and mentions the proper unit.

@PVince81
Copy link
Contributor

PVince81 commented Jun 8, 2016

This is done in 9.1

@lock
Copy link

lock bot commented Aug 4, 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 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants