Skip to content

Excludes: Further optimize also patterns with slash and add trailing slash to some of the items in existing sync-exclude.lst #5017

Closed

Description

@sagamusix

Actual behaviour

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).

Activity

  1. changed the title [-]ownCloud still consuming excessive amount of CPU[/-] [+][2.2.2]ownCloud still consuming excessive amount of CPU[/+] on Jun 28, 2016
  2. guruz commented on Jun 28, 2016

    @guruz
    Contributor

    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 ?

  3. sagamusix commented on Jun 28, 2016

    @sagamusix
    Author

    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.

  4. added this to the 2.3.0 milestone on Jul 5, 2016
  5. self-assigned this
    on Jul 5, 2016
  6. ckamm commented on Jul 5, 2016

    @ckamm
    Contributor

    @sagamusix I've changed the discovery thread's priority to 'low' for 2.3.0.

  7. added
    ReadyToTest
    on Jul 5, 2016
  8. sagamusix commented on Jul 5, 2016

    @sagamusix
    Author

    Thanks, looking forward to test it. :)

  9. guruz commented on Jul 12, 2016

    @guruz
    Contributor

    @sagamusix Hey! How did it go?

  10. guruz commented on Jul 12, 2016

    @guruz
    Contributor

    Woops, Just saw #5053 .. heh

  11. sagamusix commented on Jul 12, 2016

    @sagamusix
    Author

    Due to #5039 I sadly was not able to really test new the version yet, sorry!

  12. sagamusix commented on Jul 21, 2016

    @sagamusix
    Author

    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.

  13. 71 remaining items

  14. ckamm commented on Jan 13, 2018

    @ckamm
    Contributor

    I didn't spot an obvious new bottleneck and will need to try to reproduce.

    @sagamusix Is the discovery fast on 2.4.0?

  15. sagamusix commented on Jan 13, 2018

    @sagamusix
    Author

    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:

    01-13 14:07:27:806 [ debug sync.csync.updater ]	[ csync_walker ]:	file: C#/MD5-SHA1/MD5-SHA1/Form1.Designer.cs [inode=140 size=5297]
    01-13 14:07:27:807 [ debug sync.database.sql ]	[ OCC::SqlQuery::bindValue ]:	SQL bind 1 QVariant(qlonglong, -2905695774482572221)
    01-13 14:07:27:807 [ debug sync.database.sql ]	[ OCC::SqlQuery::exec ]:	SQL exec "SELECT path, inode, modtime, type, md5, fileid, remotePerm, filesize,  ignoredChildrenRemote, contentchecksumtype.name || ':' || contentChecksum FROM metadata  LEFT JOIN checksumtype as contentchecksumtype ON metadata.contentChecksumTypeId == contentchecksumtype.id WHERE phash=?1"
    01-13 14:07:27:807 [ info sync.csync.updater ]:	Database entry found, compare: 1279370295 <-> 1279370295, etag:  <-> 9ddb26eaeca31a2f31577640d4d7d065, inode: 140 <-> 140, size: 5297 <-> 5297, perms: 0 <-> 9f, ignore: 0
    

    And then a minute later:

    01-13 14:08:46:231 [ debug sync.csync.updater ]	[ csync_walker ]:	file: C#/MD5-SHA1/MD5-SHA1/Form1.Designer.cs [file_id=00118633oc79c8z0bi2n size=5297]
    01-13 14:08:46:231 [ debug sync.database.sql ]	[ OCC::SqlQuery::bindValue ]:	SQL bind 1 QVariant(qlonglong, -2905695774482572221)
    01-13 14:08:46:231 [ debug sync.database.sql ]	[ OCC::SqlQuery::exec ]:	SQL exec "SELECT path, inode, modtime, type, md5, fileid, remotePerm, filesize,  ignoredChildrenRemote, contentchecksumtype.name || ':' || contentChecksum FROM metadata  LEFT JOIN checksumtype as contentchecksumtype ON metadata.contentChecksumTypeId == contentchecksumtype.id WHERE phash=?1"
    01-13 14:08:46:231 [ info sync.csync.updater ]:	Database entry found, compare: 1279370295 <-> 1279370295, etag: 9ddb26eaeca31a2f31577640d4d7d065 <-> 9ddb26eaeca31a2f31577640d4d7d065, inode: 0 <-> 140, size: 5297 <-> 5297, perms: 9f <-> 9f, ignore: 0
    01-13 14:08:46:231 [ info sync.csync.updater ]:	file: C#/MD5-SHA1/MD5-SHA1/Form1.Designer.cs, instruction: INSTRUCTION_NONE <<=
    
  16. ckamm commented on Jan 13, 2018

    @ckamm
    Contributor

    @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.

  17. sagamusix commented on Jan 13, 2018

    @sagamusix
    Author

    I couldn't find such a line in the log. This is how the first discovery ends and the second starts:

    01-13 15:23:26:608 [ debug sync.csync ]	[ csync_update ]:	Update detection for local replica took 77.21 seconds walking 200395 files.
    01-13 15:23:26:608 [ debug sync.discovery ]	[ OCC::DiscoveryJob::remote_vio_opendir_hook ]:	OCC::DiscoveryJob(0x77f4f98)  Calling into main thread...
    01-13 15:23:26:608 [ info sync.accessmanager ]:	6 "PROPFIND" "https://*******/remote.php/dav/files/johannes/Sources" has X-Request-ID "921fdbb0-ca3b-41c5-b7af-bf1fe05cc742"
    01-13 15:23:26:608 [ debug sync.cookiejar ]	[ OCC::CookieJar::cookiesForUrl ]:	QUrl("https://*******/remote.php/dav/files/johannes/Sources") requests: (QNetworkCookie("oc_sessionPassphrase=UhSJsMtkzk0%2BOgkmy4bWijQPF78%2FcfPH6e4a7hOvu6XWCEUJtA%2Fd9fnh0E84EK5sUXpncgeWdoNAOaAjUIBVkFi5z9ixiVSUy7kCqTEHkohQ07cMW%2FgSOP%2BLS%2BQm9ES6; secure; HttpOnly; domain=home.schultz.re; path=/wolke"), QNetworkCookie("oc79c8z0bi2n=qs3r32lr9d15k1l123n2u7mrb6; secure; HttpOnly; domain=home.schultz.re; path=/wolke"))
    01-13 15:23:26:608 [ info sync.networkjob ]:	OCC::LsColJob created for "https://*******" + "/Sources" "OCC::DiscoverySingleDirectoryJob"
    01-13 15:23:27:475 [ info sync.networkjob.lscol ]:	LSCOL of QUrl("https://*******/remote.php/dav/files/johannes/Sources") FINISHED WITH STATUS QNetworkReply::NetworkError(NoError) ""
    01-13 15:23:27:476 [ debug sync.discovery ]	[ OCC::DiscoveryMainThread::singleDirectoryJobFirstDirectoryPermissionsSlot ]:	Permissions for root dir: "DNVCKR"
    01-13 15:23:27:481 [ debug sync.engine ]	[ OCC::SyncEngine::slotRootEtagReceived ]:	Root etag: "\"5a33bb48440d2\""
    01-13 15:23:27:481 [ info gui.folder ]:	Root etag from during sync: "\"5a33bb48440d2\""
    01-13 15:23:27:481 [ debug sync.discovery ]	[ OCC::DiscoveryMainThread::singleDirectoryJobResultSlot ]:	Have 14 results for  "/Sources"
    01-13 15:23:27:482 [ debug sync.networkjob ]	[ OCC::AbstractNetworkJob::slotFinished ]:	Network job OCC::LsColJob finished for "/Sources"
    01-13 15:23:27:482 [ debug sync.discovery ]	[ OCC::DiscoveryJob::remote_vio_opendir_hook ]:	OCC::DiscoveryJob(0x77f4f98)  ...Returned from main thread
    01-13 15:23:27:482 [ debug sync.csync.updater ]	[ csync_walker ]:	directory: C# [file_id=00118624oc79c8z0bi2n]
    01-13 15:23:27:483 [ debug sync.database.sql ]	[ OCC::SqlQuery::bindValue ]:	SQL bind 1 QVariant(qlonglong, -6906474125601790833)
    01-13 15:23:27:483 [ debug sync.database.sql ]	[ OCC::SqlQuery::exec ]:	SQL exec "SELECT path, inode, modtime, type, md5, fileid, remotePerm, filesize,  ignoredChildrenRemote, contentchecksumtype.name || ':' || contentChecksum FROM metadata  LEFT JOIN checksumtype as contentchecksumtype ON metadata.contentChecksumTypeId == contentchecksumtype.id WHERE phash=?1"
    01-13 15:23:27:483 [ info sync.csync.updater ]:	Database entry found, compare: 1458847545 <-> 1458847545, etag: 56f43f3a90e07 <-> _invalid_, inode: 0 <-> 99, size: 0 <-> 0, perms: fd <-> fd, ignore: 0
    01-13 15:23:27:483 [ info sync.csync.updater ]:	file: C#, instruction: INSTRUCTION_EVAL <<=
    01-13 15:23:27:483 [ debug sync.discovery ]	[ OCC::DiscoveryJob::remote_vio_opendir_hook ]:	OCC::DiscoveryJob(0x77f4f98) C# Calling into main thread...
    01-13 15:23:27:484 [ info sync.accessmanager ]:	6 "PROPFIND" "https://*******/remote.php/dav/files/johannes/Sources/C%23" has X-Request-ID "5f43b27f-ec2b-4231-b5fb-1d512acbb108"
    01-13 15:23:27:484 [ debug sync.cookiejar ]	[ OCC::CookieJar::cookiesForUrl ]:	QUrl("https://*******/remote.php/dav/files/johannes/Sources/C%23") requests: (QNetworkCookie("oc_sessionPassphrase=UhSJsMtkzk0%2BOgkmy4bWijQPF78%2FcfPH6e4a7hOvu6XWCEUJtA%2Fd9fnh0E84EK5sUXpncgeWdoNAOaAjUIBVkFi5z9ixiVSUy7kCqTEHkohQ07cMW%2FgSOP%2BLS%2BQm9ES6; secure; HttpOnly; domain=home.schultz.re; path=/wolke"), QNetworkCookie("oc79c8z0bi2n=qs3r32lr9d15k1l123n2u7mrb6; secure; HttpOnly; domain=home.schultz.re; path=/wolke"))
    01-13 15:23:27:485 [ info sync.networkjob ]:	OCC::LsColJob created for "https://*******" + "/Sources/C#" "OCC::DiscoverySingleDirectoryJob"
    01-13 15:23:28:136 [ info sync.networkjob.lscol ]:	LSCOL of QUrl("https://*******/remote.php/dav/files/johannes/Sources/C%23") FINISHED WITH STATUS QNetworkReply::NetworkError(NoError) ""
    01-13 15:23:28:137 [ debug sync.discovery ]	[ OCC::DiscoveryMainThread::singleDirectoryJobResultSlot ]:	Have 2 results for  "/Sources/C#"
    01-13 15:23:28:137 [ debug sync.networkjob ]	[ OCC::AbstractNetworkJob::slotFinished ]:	Network job OCC::LsColJob finished for "/Sources/C#"
    
  18. ckamm commented on Jan 13, 2018

    @ckamm
    Contributor

    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?

  19. sagamusix commented on Jan 13, 2018

    @sagamusix
    Author

    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.

  20. ckamm commented on Jan 13, 2018

    @ckamm
    Contributor

    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)?

  21. sagamusix commented on Jan 13, 2018

    @sagamusix
    Author

    Alright, I'll see how it behaves with a smaller sync folder.

  22. sagamusix commented on Jan 13, 2018

    @sagamusix
    Author

    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.

  23. ckamm commented on Jan 18, 2018

    @ckamm
    Contributor

    @sagamusix :(

    Okay, so:

    1. The exclude performance is fine.
    2. Remote discovery is slow.
    3. If the initial hour-long remote discovery is aborted, it has to be done again from scratch.
    4. 503s during propagation can freeze the client.

    @ogoffart

  24. michaelstingl commented on Jan 18, 2018

    @michaelstingl
    Contributor

    503s during propagation can freeze the client.

    @SamuAlfageme please check. Related to #5859 ?

  25. guruz commented on Feb 12, 2018

    @guruz
    Contributor

    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.

    Ack, see #2976

  26. ckamm commented on Feb 15, 2018

    @ckamm
    Contributor

    @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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions