Skip to content

Excessive CPU usage ownCloud 2.2.1 #4967

Closed

Description

@jabdoa2

Expected behaviour

When I change one file, ownCloud should synchronise that file. CPU usage should stay low.

Actual behaviour

When I change one file, ownCloud starts to scan the sync folder and uses 100% of CPU for about some seconds. If you changed another file in the meantime it rescans right away and stays at 100% CPU for minutes. This is annoying if you keep editing files (which is not uncommon).

This did not happen in older clients (at least they were not keeping the CPU at 100% all the time).

Steps to reproduce

  1. Start OwnCloud client
  2. Edit a file in the sync folder

Server configuration

Operating system: Ubuntu 14.04

Web server: Apache

Database: MySQL

PHP version: 5.6

ownCloud version: 8.2.5

Storage backend: Files

Client configuration

Client version: 2.2.1

Operating system: (L)Ubuntu 14.04

OS language: DE

Installation path of client: /usr/bin/owncloud

Logs

  1. Output of owncloud
06-15 13:44:26:513 0x22e2460 detected changes in paths: QSet("/folder/xxx.myfile")
06-15 13:44:26:513 0x22e2460 Schedule folder  "ownCloud"  to sync!
06-15 13:44:26:514 0x22e2460 Sync state changed for folder  "https://url.xx/remote.php/webdav/" :  "Not yet Started"
06-15 13:44:26:514 0x22e2460 void OCC::ServerNotificationHandler::slotFetchNotifications(OCC::AccountState*) Account "[email protected]" does not have notifications enabled.
06-15 13:44:26:514 0x22e2460 Scheduling a sync in 2 seconds
[...]
06-15 13:44:39:859 0x22e2460 No database Transaction to commit
06-15 13:44:39:878 0x22e2460 CSync run took  11355
  1. Web server error log: No errors
  2. ownCloud log (data/owncloud.log): No problem here

Activity

  1. guruz commented on Jun 15, 2016

    @guruz
    Contributor

    @jabdoa2 This is interesting. We always rescan all paths if a single file changes and on startup, this is nothing that changed over the different versions.

    How many files/folders do you have? It should not be at 100% for minutes, maybe for some seconds?

  2. added this to the milestone on Jun 15, 2016
  3. jabdoa2 commented on Jun 15, 2016

    @jabdoa2
    Author

    Maybe it did it less efficient/less often before? As you see in the log it takes about 13s for one run. On this machine some folders are excluded. I got about 62k files to synchronise:

    $ find | wc -l
    62025
    

    Since most IDEs autosave changes its not uncommon to always have a changed file in the folder which leads to the behaviour from above.

  4. ogoffart commented on Jun 15, 2016

    @ogoffart
    Contributor

    If you don't enable any logging flags (which is also slowing down the sync),
    most of the time during the discovery is spent in analysing the exclude list.

    We indeed added a few entries to the exclude list.

  5. jabdoa2 commented on Jun 15, 2016

    @jabdoa2
    Author

    I always disabled the exclusion list in the client (because i want to synchronise dot files for example). As long as there are no hidden exclusions, it should be empty. System runs on a SSD and an i7 (mobile 2 cores + HT).

    I noticed the issue because the fan of my notebook started to run permanently when I use my IDE to edit stuff. This did not happen before. Also it only happens when I edit stuff. Average system load is at about 2 and its mostly caused by the ownCloud client (it takes 2 out of 4 HT cores).

  6. Instinct64 commented on Jun 15, 2016

    @Instinct64

    Windows 10 x64 - OwnCloud Client 2.2.1

    I'm seeing similar behaviour, OwnCloud is regularly taking several minutes scanning and consuming ~18% CPU (Gen 6 i7), even when no files have changed. Once the scan is completed, it seems to wait for about ~30 seconds and then repeats the scan.

    Our company uses OwnCloud for filesharing between clients and we have a few hundred folders in total. This is problematic for laptop users like myself for example, where constant background CPU drains battery very quickly.

  7. patrickhafner commented on Jun 16, 2016

    @patrickhafner

    OS X 10.11.5
    ownCloud Client 2.2.1
    ownCloud 8.2.5

    Excessive CPU usage as well while scanning my sync folders for changes. The process is running at 100% CPU load on one core then. Hidden files won't sync.

    You can see the high CPU usage twice in this graph (every time, ownCloud is looking for changes):
    bildschirmfoto 2016-06-16 um 00 18 04

  8. sagamusix commented on Jun 16, 2016

    @sagamusix

    I can also confirm that ownCloud almost constantly eats a whole CPU core here on Windows 7, and with a dual-core setup things get sluggish very quickly if some other application also does some CPU-intensive work. If you're not already doing so, the scan thread should probably work at one of the lowest possible thread priorities. Manually changing the entire process priority via Task Manager to something lower than default seems to make Windows more responsive again, so I guess that the client might not reduce the thread priority at the moment.

  9. guruz commented on Jun 17, 2016

    @guruz
    Contributor

    @sagamusix @patrickhafner @Instinct64 Do you guys think the previous client versions were better in this regard?

  10. Instinct64 commented on Jun 17, 2016

    @Instinct64

    I've reverted to 2.1.1 in order to test this. I see that OwnCloud only ramps up it's CPU usage for a few seconds, rather than the near continuous ~20% usage I see on my machine with 2.2.1.

  11. FlorentCoppint commented on Jun 17, 2016

    @FlorentCoppint

    Same issue as @Instinct64, client is using 100% of one core, stops a few minutes, then using 100% again...

  12. dragotin commented on Jun 17, 2016

    @dragotin
    Contributor

    @Instinct64 @FlorentCoppint do you use overlay icons in a file manager?

  13. Instinct64 commented on Jun 17, 2016

    @Instinct64

    @dragotin Owncloud applies it's own overlay icons in Windows Explorer. I dont have any other apps applying overlay icons in the Owncloud folders.

  14. 24 remaining items

  15. added a commit that references this issue on Jun 21, 2016
  16. ckamm commented on Jun 21, 2016

    @ckamm
    Contributor

    @guruz Pull request to set up logging earlier: #4991

  17. added a commit that references this issue on Jun 21, 2016
  18. jabdoa2 commented on Jun 21, 2016

    @jabdoa2
    Author

    I checked the file which are references above: /home/xxx/.local/share/data/ownCloud/sync-exclude.lst is indeed empty. However, /etc/ownCloud/sync-exclude.lst is not empty. Thus, I assume that my ignore list is also not empty.

    Is that intended? I checked "Sync hidden files". Why is it still ignoring some files?

  19. guruz commented on Jun 21, 2016

    @guruz
    Contributor

    Everyone: 2.2.2 will be released in the next hours. Please try with that.

    @jabdoa2 it is probably ignoring the files because they are still in the exclude list?

  20. jabdoa2 commented on Jun 21, 2016

    @jabdoa2
    Author

    @guruz I restarted the client. What do you mean by "still in the exclude list"? I checked "Sync hidden files" to tell the client that it should sync everything. Also how should the client (runs as user) modify /etc/ownCloud/sync-exclude.lst which is owned by root? I don't understand why there is an additional exclude list which is apparently used but not displayed and cannot be changed/viewed by the user.

  21. ckamm commented on Jun 21, 2016

    @ckamm
    Contributor

    @jabdoa2 There is an extra exclude list that contains patterns like ".~" or "Thumbs.db" to skip files that people usually don't want to sync, even if they want to sync other hidden files. You can see and edit the list in General/Advanced/Edit Ignored Files.

  22. added
    ReadyToTest
    and removed on Jun 21, 2016
  23. sagamusix commented on Jun 22, 2016

    @sagamusix

    Using the nightly build linked above, ownCloud remains using up an entire core here. I am not entirely sure if it used to be like this in 2.1.1.

  24. Instinct64 commented on Jun 23, 2016

    @Instinct64

    I've been trying ownCloud-2.2.2.6187-nightly20160620 (Windows) for the last couple days and it seems to have resolved the issue I was seeing.

  25. patrickhafner commented on Jun 24, 2016

    @patrickhafner

    The 2.2.2 Stable (build 3472), downloaded from official website is working for me on OS X as well. Thank you for this patch!

  26. dragotin commented on Jun 24, 2016

    @dragotin
    Contributor

    Kudos to @guruz and @ckamm - and everybody who tested :-)

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

Metadata

Metadata

Assignees

Labels

ReadyToTestsev2-hightype:bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions