-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Dynamic chunk sizing for faster upload of big files #1620
Comments
I am not that into /core but why should there such a high load of SQL when using smaller chunks? |
Hi! I checked the load. With 1M chunks the server (4GB RAM, 4 core Celeron) I also think that the php+SQL tasks performed with every chunk are The bottom line is that more such delays in a given timeframe the more I hope the info is helpful in some way. Sven On 04/21/2016 08:09 PM, Tobias Kaminsky wrote:
|
another observation: In Linux desktop client the same speed dropping is evident at gigabit link. When I add a big file (500MB) to my sync folder and the client starts to upload it to server the upload starts lets say at 40 MB/s and drops to ~15 MB/s at the end of upload. As the speed is still high enough I dont bother but the same logic seems to affect it somehow. Chunk size default 1M I guess as I have stock client. Edit: Server load topped ~60% in this upload. Maybe it is server limited this time as changing the chunk size to 10M or even 100M with "export OWNCLOUD_CHUNK_SIZE" + client restart did not fix the slowdown entirely - got 20MB/s in the end of upload. Edit2: Problem source is probably client software speed (and platform its running on). Namely over wifi on desktop I get constant 15 MB/s upload (300 Mbit/s link). So the client is fast enough for that TCP link and server is able to handle. Over gigabit the slowdown is probably caused by server as on client side no significant load is observable. Android phone is not fast enough to upload 1M chunks over 40Mbit/s TCP link and crawls. With 10M chunks speed is ok for 40 Mbit/s - no degradation. |
Sounds a lot like: owncloud/client#4354 |
It seems like it's not fixed yet (still getting it on 2.1.0, but I can't use 2.1.1/2.1.2/2.1.3 due to "App not responding to touch events #1799" bug in android client versions past 2.1.0). Edit: |
Let me update the title for better visibility in list of issues. Thanks. Related: owncloud/client#4875 |
Will be solved with with support for TUS.io upload protocol (#2978) |
Expected behaviour
Big files should be easy to upload and should not stress server nor client as there should be moderate SQL activity (in contrast to notorious small file upload slowdown problems)
Actual behaviour
In Android sync client big files (ten or hundreds of megabytes) are generally slow to upload. For example a 200 MB video starts off nicely at somewhat below connection limited speed but drops in about 1 minutes gradually to ~30% of the speed and further down. My server is powerful (4 cores, 4GB RAM etc.) and connection to the server is over wifi (real TCP throughput ~40 Mbit). Example: upload starts at ~25 Mbit/s. In 60 sec its down to 10 Mbit and in 120s its ~5-6 mbit (given that the file is big enough).
Steps to reproduce
Can this problem be reproduced with the official owncloud server?
(url: https://demo.owncloud.org, user: test, password: test)
Cannot test - my outside uplink is too slow. I am using server ownCloud 8.2.3 (beta) myself currently. Similar problems persisted with 8.1.
SOLUTION
I recompiled the 1.9.1 source with one modification in file /owncloud-android-library/src/com/owncloud/android/lib/resources/files/ChunkedUploadRemoteFileOperation.java
RESULT
Enormous speedup. My uploads go at ~40 Mbit/s and speed is not dropping !
So the problem is the CHUNK size that fragments the upload, and creates obviously comparably more SQL activity at server.
If you are interested in recompiled apk, ask me: sven(at)omapilv.ee
RECOMMENDATION for FIX
Add possibility to change chunk size to 10M in settings. Choise is needed as some people may find it convenient to use 1M chunk for unstable connections (discussed in some threads). In wifi its usually not needed.
Environment data
Android version:
5.1
Device model:
One Plus X
Stock or customized system:
Stock
ownCloud app version:
1.9.1
ownCloud server version:
8.2.3
The text was updated successfully, but these errors were encountered: