core icon indicating copy to clipboard operation
core copied to clipboard

An often interrupted connection causes lots of chunks and partial files.

Open VincentvgNn opened this issue 11 years ago • 7 comments

Description

I have OC sever 8.0.3 running at a web-hosting company. The Apache server is shared with other customers. The data transfer speed may be throttled down and I'm assured of connection interrupts every 1 to 7 minutes. So the upload of large files will be interrupted many times. I see temporary blacklisting happening and when I'm lucky, the last large files (10-30 MB) will be uploaded after one or two days. The good thing is that, with some patience, all 4500 files (800 MB) were uploaded and downloaded at the other synced clients. The bad thing is that 2,8 GB was needed for the complete owncloud folder. And the worst is that 1,3 GB of that 2,8 GB is used for garbage (chunks and .part files).

Steps to reproduce

  1. Start with a clean installation of the OC server and use the client software on 3 PC's. I have Client-1 on Win 7, Client-2 on Win 8 and Client-3 on Win XP All 3 clients get 100 MB storage assigned and the Admin gets 2 GB.
  2. Let the Admin share a folder with all 3 clients getting r/w permissions.
  3. For the test I used 800 MB data (4500 files, 700 folders, at least 20 files of 10-30 MB). Have the OC sync running on all 3 computers and copy the 800 MB test data into the local shared folder at Client-3. Client-3 starts uploading and after a short while Client-2 and Client-3 will start downloading.
  4. Client-3 shows problems with large files (> 5 MB) due to interrupts of the connection. The blacklisting comes into action and it delays the retrials for uploading. After some good periods of a longer connection time or a higher transfer speed all files will be uploaded after 1 or 2 days.
  5. The data should only be stored in the Admin's data folder on the server.

After finalization, the owncloud root folder showed 2,8 GB used storage for only 800 MB data !!

  • I found about 220 chunks of 1 to 5,1 MB in the cache of Client-3 occupying 900 MB (should be zero)
  • Disk-space used for the encryption about 100 MB
  • Needed for the OC server software when nothing stored: estimated about 200 MB
  • Data-space for the Admin 1,6 GB (should be about 1,5 x 800 MB = 1,2 GB due to the encryption!)
  • Data-space for the .part files 400 MB (I found 170 files, size about 0 to 6,4 MB max)
  • So 900 + 400 = 1,3 GB was lost to garbage files!

Expected behavior

The server space does not get filled with chunks and partial files.

Client configuration

ownCloud version: 1.8.1 (build 5050) Operating system for testing: Win 7, Win 8 or Win XP Browser: Google Chrome (or Firefox or IE11)

Server configuration

ownCloud version: 8.0.3 (stable) List of activated apps: default apps + encryption External storage: no Encryption: yes

OC server installed at a webhosting company. 4-5 GB storage on a shared server. Control panel DirectAdmin. Installation by using Installatron. Own (non-shared) IP and using https. Operating system: Linux Hosting Package Web server: Apache Database: MySQL PHP version: native, 5.5.21

VincentvgNn avatar May 26 '15 18:05 VincentvgNn

Ideally chunks should get cleant up in background jobs (because OC cannot always reliably detect failed/aborted uploads): https://github.com/owncloud/core/issues/14646

Let's still keep your ticket for the part files.

PVince81 avatar May 27 '15 09:05 PVince81

@PVince81 Thanks for your response.

I just see that the improvement you'r referring to will be introduced in server 8.2-next. So I can't test that for the next months. Luckily the chunks are in one cache folder and I can delete them manually.

The clean-up should also work when I login to the web-UI of Client-3. Client-3 did the upload and the files were stored in the Admin's encrypted and shared data folders. Client-3 got the chunks and none of the stored files. OC just displays 2,3 MB used out of 100 MB for the original example files. I do not see any evidence of a clean-up operation. Can the sharing and/or the encryption block the clean-up? How can I activate the clean-up script for Client-3? Is there a timer or counter on it?

Manually removing the part files from the Admin's data folders is quite difficult. All folder tree branches have to be scanned. So there a solution is needed most.

VincentvgNn avatar May 27 '15 11:05 VincentvgNn

  1. The "cache" folder for a user is cleant up only when that user logs in again when the login hook is triggered. This might not happen often if the sessions are permanent or refreshed constantly. So it's not reliable enough, that's why it will be added as cron job as per https://github.com/owncloud/core/issues/14646

As a workaround, you could setup your own cron job (ex: shell script) that searches through all cache folders for files older than a day, then delete them (I expect the future background job to do something similar).

  1. For the part files

Yes, this is tricky, as one needs to recurse into all subdirectories to find them. Also, part files are not indexed in "oc_filecache", so the search operation needs to happen on-disk. This might also be possible with a cron job (ex: shell script), but could be expensive.

Maybe the part files (aka upload transactions) could be listed somewhere in the database, including the path to the pending part file. This way it could be easier to cancel them and automatically remove all matching chunks + part files, and remove the need to recurse on filesystem-level.

PVince81 avatar May 27 '15 12:05 PVince81

For people who got here via google or others, here is my cron job that runs at night and finds and deletes 24h old cache files.

find /www/owncloud/data/*/cache -type f -mmin +$((60*24)) -exec rm -v {} \;

bglnelissen avatar Jun 12 '15 13:06 bglnelissen

@DeepDiver1975 will the new chunking help with that ?

Else we need to do the garbage collection through cron: https://github.com/owncloud/core/issues/14646

PVince81 avatar Jun 15 '16 11:06 PVince81

Closing in favor of https://github.com/owncloud/core/issues/14646

The new chunking is also storing chunks on-disk, so these would also need cleanup.

PVince81 avatar Oct 14 '16 16:10 PVince81

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[bot] avatar Aug 03 '19 09:08 lock[bot]