Very slow upload speed for small files
When synchronizing a directory with "large" (>1 mb) files, I get the maximum available upload speed. But when I try to synchronize a directory with many small (a few kb) files (in a nested folder hierarchy), it is terribly slow and I have to deal with an upload speed less than a few kb/s. This issue appears with Windows clients as well as Linux clients (version 1.1.4) syncing to a server running ownCloud 4.5.5.
Maybe a parallel upload of a few small files or somehow grouping them together would fix this issue.
I can confirm this issue (OC 4.5.5, Linux client 1.1.4). IMHO this also has to do with having a deep directory hierarchy.
I think the problem is primarily due to the overhead per file/collection (reading/setting props, caching the file locally etc.) which ends up being more costly than the actual data transfer for small files and collections. This also already affects walking the the remote filesystem when checking for modifications.
Maybe as a first step it would help to batch the metadata operations concerning the same collection, i.e. do a single PROPFIND for a collection and evaluate all its members for changes from that one multistatus response (later, the PROPFIND depth could be increased even further, in theory up to requesting the complete remote hierarchy en bloc).
Also, wouldn't it be possible to extend the owncloud implementation of the PUT command to support passing the modification time as a request header when uploading the file so that no additional PROPPATCH request is necessary after the upload?
As suggested above, when actually transferring file data, batching several transfers in parallel could increase throughput. (This is probably tricky because as far as I understand, the way csync handles transfers is limited to handling only a single file at a time.)
Split the 212 into smaller issues: Issue #223 - Is about up/down multi threading
same for me
#900
+1
Client: Mac OS X 10.8.4, client version 1.3.0 Server: Ubuntu 12.04, ownCloud version 5.0.10, set up with nginx
Up-syncing a 30 MB folder consisting of 400 files took about 90 minutes.
I can confirm this issue with sync client version 1.3.0. Syncing takes way too long time when there are some hundreds of files involved. Did a test with ~ 7000 files and 35GB, it took over 10 hours on a LAN with 1gb/s connection between the client and the server. I have done several tests and all the tests show me the same pattern. Also, the client isn't able to sync correctly between multi devices. There are missing files between the devices.
I would like to ask if this bug is assigned to the right component.
I can basically confirm the upload of small files is very slow but in my eyes the bottleneck is the server. I watched the server while the upload was running and saw a high load.
Anyone tried with fast hardware (2 - 4 GB Ram and a multicore CPU)?
@blackm : I had a look at my server load during the upload (8 CPU cores, several GB of RAM). There was almost no load in CPU usage as well as ongoing network usage.
@fiedl Can you quantify this a bit better?
@danimo : Sure.
CPU and memory usage: Using top, the highest process is php5-fascgi, which is used by ownCloud. Its cpu usage, most of the time, is between 0,1% and 10%, but never higher than 20%. Memory is constantly at 0.1%.
Network usage: Using tcptrack, I monitor the connection to my client. Every few seconds, a new connection is opened and the existing one is closed. The speed is between 0 KB/s and 2 KB/s.
@fiedl Hmm, 20% on an 8 core machine is ~1,5 busy cores, right? One occupied by the PHP process, and one by the Database. Memory is not an issue, the server currently is IO, and specifically DB-query bound.
@danimo : Correct me, if I'm mistaken: The top cpu usage should show 100% for one core being fully occupied. For multiple core processes, this number could be greater than 100%, in my case max 800%.
To be sure, I've verified this using htop. Here you can see the load of the separate cores:

Today I had a similar issue, somebody uploaded 30.000 <1kb files.
The load on the system is somewhat high because there is a lot of overhead for every file.
The real problem in my opinion isn't that that file upload takes a long time (that should be fixed and the load could be improved (maby). But the most annoying thing is that owncloud stops downloading new files when it is upload.
In my opinion owncloud should do a bidirectional sync when it can download and upload at the same time (or atleast stop uploading every once in a while to check for new downloads)
+1 for some solution of this problem
As far as I could see this is mostly a server issue (and not a fine-tuning issue but a real bug): adding new file is ~O(N) where N is the number of files already in the directory (you should see the upload rate slower and slower as the files are added - please confirm)
https://github.com/owncloud/core/issues/5084
Not sure how easy it is to fix that because it looks like unwanted dependencies in the heart of the framework.
Please note that the main problem here is not the slow way the server might be processing things, but the fact that we upload files sequentially instead of in parallel. This might change with 1.5 or 1.6 though. Then you get a better saturation of your connection. Stay tuned..
Moving issue to 1.6 1.5 already does a better job by having only 1 request for n upload instead of 3.
Just for information, I just tested Mirall 1.5 1.4.2 against OC 6 RC (realeased today). It takes 3.5 seconds to upload a picture of 1,39 Mo. When I look at the transfer in the config window of Mirall, it appears that the upload itself is very fast (<<0.5 seconds, as far as I can measure it ;-) ), but it takes a lot of time between files. Encryption was activated for that.
11-28 15:22:33:311 _csync_push_file: PUSHED file: ownclouds://myserver.no-ip.biz/owncloudbeta/remote.php/webdav/Liban/Liban (77).JPG 11-28 15:22:33:312 csync_vio_stat: Win32: STAT-inode for D:\TestOC Liban/Liban (38).JPG: 15094 11-28 15:22:33:330 _csync_push_file: Remote repository atomar push enabled for ownclouds://myserver.no-ip.biz/owncloudbeta/remote.php/webdav/Liban/Liban (38).JPG (0). 11-28 15:22:33:330 oc_module: => open called for ownclouds://myserver.no-ip.biz/owncloudbeta/remote.php/webdav/Liban/Liban (38).JPG 11-28 15:22:33:331 oc_module: Stating directory ownclouds://myserver.no-ip.biz/owncloudbeta/remote.php/webdav/Liban 11-28 15:22:33:331 oc_module: Dir ownclouds://myserver.no-ip.biz/owncloudbeta/remote.php/webdav/Liban is there, we know it already. 11-28 15:22:33:331 oc_module: PUT request on /owncloudbeta/remote.php/webdav/Liban/Liban%20%2838%29.JPG! 11-28 15:22:33:331 oc_module: Sendfile handling request type PUT. fd 3 11-28 15:22:33:331 hbf_splitlist: hbf_splitlist: block_size: 10485760 threshold: 10485760 st_size: 1460769
11-28 15:22:33:331 hbf_splitlist: hbf_splitlist: num_blocks: 1 rmainder: 1460769 blk_size: 10485760
11-28 15:22:33:331 hbf_splitlist: hbf_splitlist: created block 0 (start: 0 size: 1460769) 11-28 15:22:33:331 oc_module: about to send 1 block 11-28 15:22:33:331 _hbf_dav_request: HBF: Block: 0 , Start: 0 and Size: 1460769 11-28 15:22:33:698 oc_module: Chunk upload completed for 'ownclouds://myserver.no-ip.biz/owncloudbeta/remote.php/webdav/Liban/Liban (38).JPG' (1460769 bytes out of 1460769) 11-28 15:22:35:709 oc_module: * Upload finished ownclouds://myserver.no-ip.biz/owncloudbeta/remote.php/webdav/Liban/Liban (38).JPG 11-28 15:22:35:710 oc_module: Setting LastModified of /owncloudbeta/remote.php/webdav/Liban/Liban%20%2838%29.JPG to 1384816675 11-28 15:22:36:534 oc_module: owncloud_stat ownclouds://myserver.no-ip.biz/owncloudbeta/remote.php/webdav/Liban/Liban (38).JPG called 11-28 15:22:36:808 oc_module: Simple propfind result code 207. 11-28 15:22:36:808 oc_module: => Errno after fetch resource list for ownclouds://myserver.no-ip.biz/owncloudbeta/remote.php/webdav/Liban/Liban (38).JPG: 0 11-28 15:22:36:808 oc_module: Working on file Liban (38).JPG 11-28 15:22:36:808 oc_module: STAT result from propfind: Liban (38).JPG, mtime: 1384816675 11-28 15:22:36:809 oc_module: Get file ID for ownclouds://myserver.no-ip.biz/owncloudbeta/remote.php/webdav/Liban/Liban (38).JPG: 529751ac542ce 11-28 15:22:36:809 _get_md5: MD5 for ownclouds://myserver.no-ip.biz/owncloudbeta/remote.php/webdav/Liban/Liban (38).JPG: 529751ac542ce 11-28 15:22:36:809 _csync_push_file: FINAL MD5: 529751ac542ce 11-28 15:22:36:809 _csync_push_file: PUSHED file: ownclouds://myserver.no-ip.biz/owncloudbeta/remote.php/webdav/Liban/Liban (38).JPG
For Information, now with Mirall 1.5 Beta 1 against OC6 RC1.
Same folder and configuration: in 160 sec, 80 files (118 Mo) were uploaded. In average, 2sec / file. 1.5 Mo/file No speed problem for the bandwidth: local network. And no encryption this time.
Multiply the upload speed by almost 2, that's a great improvement! But there are still improvement possible I hope ;)
Thanks to the team for this!
+1 for speed improvements here. Files are being uploaded fast, but then we wait around for a while until OC figures out what to do with it, it seems.