You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Excludes: Further optimize also patterns with slash and add trailing slash to some of the items in existing sync-exclude.lst #5017
Even after fixing #4967, ownCloud keeps eating an entire CPU core for me at times, which I think it already did in 2.1.1 from time to time, so it might be a problem not caught by the fix for #4967.
I'm running ownCloud on a dual-core CPU, so it becomes obvious that something is wrong as soon as another application maxes out the other core. ownCloud's scan thread (which I assume is responsible for this high CPU usage) should run with a rather low priority as it is essentially a background service. This way, "normal" threads should be able to take over the CPU when they need it, meaning that the applications that I actually intend to use would be more responsive.
As the question already came up in #4967, Explorer overlays are disabled.
Client configuration
Client version: 2.2.2-6192
Operating system: Windows 7 x64
OS language: German
Installation path of client: Default
---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/35564531-2-2-2-2-3-windows-owncloud-still-consuming-excessive-amount-of-cpu?utm_campaign=plugin&utm_content=tracker%2F216457&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F216457&utm_medium=issues&utm_source=github).
Although I'm wondering if you're right about that we shut throttle the discovery a bit to not make the CPU go up so much and the CPU fan spin. Opinions @owncloud/desktop-developers ?
I do think it would be a sensible modification. Naturally optimizing the code itself should be one important part of fixing performance-related problems. But on the other hand (unless there is any artificial throttling) it is just natural that ownCloud will consume an entire CPU core when scanning folders. This is exactly what you want (it is generally known that "race to idle" is a good power-saving strategy) when you are alone on the system, but when there are other threads, you are competing for resources.
Other threads will most likely include other end-user software that the user actually intends to interact with, while ownCloud is just a background thread. Hence, if a lower priority is assigned to this thread, it will run at full performance when there is nothing to do (and race to idle), but if the user actually works with their system, the ownCloud thread will get fewer time slices and the remaining software will work more smoothly.
I have verified this to work as intended by setting the entire ownCloud process' priority to "lower" in the Windows task manager - when doing so, my desktop becomes more usable again.
After using 2.2.3-nightly (6258) for a day, ownCloud CPU consumption generally seems to have gone down during rescans. So far the issue seems to be fixed.
Yes, these hour-long discovery runs are definitel a new issue in the current nightlies.
However, I just noticed something really strange that might be the key to the problem.
I closely watched the ownCloud window and your calculation of discovering all the files in about one minute is accurate: After one minute, ownCloud seems to start the discovery all over again, just much more slowly (that slowdown can be noticed even in the UI).
Example from the new log obtained from this observation:
During the first minute:
@sagamusix I assume the second discovery has a "Allowing local discovery to read from the database" line. How many entries are in the "local discovery paths:" line that follows that? Thanks for your data, I think I know what the problem is now. It's unrelated to excludes.
Oh, the second discovery is just the remote discovery. I thought a second sync was starting and that that was slow. The remote discovery is much slower than the local one since it has to request data from the server. It should however be done once and then only update directories that actually change on the server.
In your particular log, Sources/C# has a _invalid_ etag that indicates it should be retrieved from the server. Maybe due to selective sync adjustments?
Hmm... So it might be that something on the server side slowed down instead? I'm not sure if there were any ownCloud server updates at the time I noticed the slowdowns, and there were also no other changes to the server itself, as far as I can remember.
It's probably not a slowdown, I'd just expect that you typically don't see your clients doing full remote discoveries. It's not done at all unless absolutely necessary - typically only when the sync folder is set up. If you set up a new 2.3.3 or 2.4.0 client with a new database it should take just as long. Maybe you could verify that this is correct by syncing a subset of your data (just a folder or so)?
With a smaller folder I could indeed observe that the full remote discovery only happened once and things were back to normal after that. It's still rather frustrating that the other remote discovery went on for five hours, was interrupted by a timeout or other error, and then restarted once again.
Edit: This time it was quicker, so now I'm back to syncing that big folder after about two hours of remote discovery.
Edit: Okay, I had another 503 shortly after the file sync started, which resulted in the whole client freezing and consuming an entire CPU core until I killed it after a few minutes. Now it's back to doing the whole remote discovery thing again.
It's still rather frustrating that the other remote discovery went on for five hours, was interrupted by a timeout or other error, and then restarted once again.
@guruz Good find. Let's do that for 2.5 if we can!
With that, I think this issue - the part about exclude performance - can be closed. @sagamusix If you get any more information about the client freeze please don't hesitate to open a new ticket. Thank you very much for all the data!
Activity
[-]ownCloud still consuming excessive amount of CPU[/-][+][2.2.2]ownCloud still consuming excessive amount of CPU[/+]guruz commentedon Jun 28, 2016
The solutions are #2297 and #4999
Although I'm wondering if you're right about that we shut throttle the discovery a bit to not make the CPU go up so much and the CPU fan spin. Opinions @owncloud/desktop-developers ?
sagamusix commentedon Jun 28, 2016
I do think it would be a sensible modification. Naturally optimizing the code itself should be one important part of fixing performance-related problems. But on the other hand (unless there is any artificial throttling) it is just natural that ownCloud will consume an entire CPU core when scanning folders. This is exactly what you want (it is generally known that "race to idle" is a good power-saving strategy) when you are alone on the system, but when there are other threads, you are competing for resources.
Other threads will most likely include other end-user software that the user actually intends to interact with, while ownCloud is just a background thread. Hence, if a lower priority is assigned to this thread, it will run at full performance when there is nothing to do (and race to idle), but if the user actually works with their system, the ownCloud thread will get fewer time slices and the remaining software will work more smoothly.
I have verified this to work as intended by setting the entire ownCloud process' priority to "lower" in the Windows task manager - when doing so, my desktop becomes more usable again.
Set discovery thread priority to low #5017
ckamm commentedon Jul 5, 2016
@sagamusix I've changed the discovery thread's priority to 'low' for 2.3.0.
sagamusix commentedon Jul 5, 2016
Thanks, looking forward to test it. :)
guruz commentedon Jul 6, 2016
@sagamusix http://download.owncloud.com/desktop/daily/ownCloud-2.3.0.6228-nightly20160705-setup.exe :)
guruz commentedon Jul 12, 2016
@sagamusix Hey! How did it go?
guruz commentedon Jul 12, 2016
Woops, Just saw #5053 .. heh
sagamusix commentedon Jul 12, 2016
Due to #5039 I sadly was not able to really test new the version yet, sorry!
sagamusix commentedon Jul 21, 2016
After using 2.2.3-nightly (6258) for a day, ownCloud CPU consumption generally seems to have gone down during rescans. So far the issue seems to be fixed.
71 remaining items
ckamm commentedon Jan 13, 2018
I didn't spot an obvious new bottleneck and will need to try to reproduce.
@sagamusix Is the discovery fast on 2.4.0?
sagamusix commentedon Jan 13, 2018
Yes, these hour-long discovery runs are definitel a new issue in the current nightlies.
However, I just noticed something really strange that might be the key to the problem.
I closely watched the ownCloud window and your calculation of discovering all the files in about one minute is accurate: After one minute, ownCloud seems to start the discovery all over again, just much more slowly (that slowdown can be noticed even in the UI).
Example from the new log obtained from this observation:
During the first minute:
And then a minute later:
ckamm commentedon Jan 13, 2018
@sagamusix I assume the second discovery has a "Allowing local discovery to read from the database" line. How many entries are in the "local discovery paths:" line that follows that? Thanks for your data, I think I know what the problem is now. It's unrelated to excludes.
sagamusix commentedon Jan 13, 2018
I couldn't find such a line in the log. This is how the first discovery ends and the second starts:
ckamm commentedon Jan 13, 2018
Oh, the second discovery is just the remote discovery. I thought a second sync was starting and that that was slow. The remote discovery is much slower than the local one since it has to request data from the server. It should however be done once and then only update directories that actually change on the server.
In your particular log,
Sources/C#has a_invalid_etag that indicates it should be retrieved from the server. Maybe due to selective sync adjustments?sagamusix commentedon Jan 13, 2018
Hmm... So it might be that something on the server side slowed down instead? I'm not sure if there were any ownCloud server updates at the time I noticed the slowdowns, and there were also no other changes to the server itself, as far as I can remember.
ckamm commentedon Jan 13, 2018
It's probably not a slowdown, I'd just expect that you typically don't see your clients doing full remote discoveries. It's not done at all unless absolutely necessary - typically only when the sync folder is set up. If you set up a new 2.3.3 or 2.4.0 client with a new database it should take just as long. Maybe you could verify that this is correct by syncing a subset of your data (just a folder or so)?
sagamusix commentedon Jan 13, 2018
Alright, I'll see how it behaves with a smaller sync folder.
sagamusix commentedon Jan 13, 2018
With a smaller folder I could indeed observe that the full remote discovery only happened once and things were back to normal after that. It's still rather frustrating that the other remote discovery went on for five hours, was interrupted by a timeout or other error, and then restarted once again.
Edit: This time it was quicker, so now I'm back to syncing that big folder after about two hours of remote discovery.
Edit: Okay, I had another 503 shortly after the file sync started, which resulted in the whole client freezing and consuming an entire CPU core until I killed it after a few minutes. Now it's back to doing the whole remote discovery thing again.
Exclude matching: Speedup the full-path traversal case
ckamm commentedon Jan 18, 2018
@sagamusix :(
Okay, so:
@ogoffart
michaelstingl commentedon Jan 18, 2018
@SamuAlfageme please check. Related to #5859 ?
guruz commentedon Feb 12, 2018
Ack, see #2976
ckamm commentedon Feb 15, 2018
@guruz Good find. Let's do that for 2.5 if we can!
With that, I think this issue - the part about exclude performance - can be closed. @sagamusix If you get any more information about the client freeze please don't hesitate to open a new ticket. Thank you very much for all the data!