Skip to content

Eternal syncing kills the phone's battery #953

Closed

Description

@llucax

I noticed a couple of days ago that my phone started to drain the battery very fast and using a program to trace which programs are using wakelocks, I found that the owncloud syncing was responsible, making my phone never entering in deep sleep.

I had to disable syncing, otherwise my battery lasts close to nothing.

Not too long ago I added some external folders to my owncloud server with a lot of files (~67K files). I wonder if that could trigger this problem (but I think I noticed this problem in my phone a few days after I added the files to the server).

A simple way to see if these 2 events are related would be to exclude the new external folders from the syncing, but I can't find any option to select which folder to sync, as you can do with the (linux) desktop app.

Activity

  1. changed the title [-]Eternal syncing with very large amount of files[/-] [+]Eternal syncing kills the phone's battery[/+] on Apr 18, 2015
  2. llucax commented on Apr 18, 2015

    @llucax
    Author

    BTW, I'm using version 1.7.0, and just as a comment, I remember something similar to this happened in the past. See #671.

  3. llucax commented on Apr 18, 2015

    @llucax
    Author

    Mmmm, looking at the server's log while syncing, I see each and every folder is queried via PROPFIND, so maybe the problem is not the number of files, but the number of folders (I have ~4K folders).

    And it looks like it takes in the order of 500ms to query one folder (at least that's the rate of lines printed in the log file), so querying 4K folders will take ~30 minutes.

  4. llucax commented on Apr 18, 2015

    @llucax
    Author

    For me the easiest workaround will be to just be able to select which folders to sync, like in the desktop app (I don't need access to all those files in my phone, they are mostly there for web access).

  5. llucax commented on Apr 18, 2015

    @llucax
    Author

    Mmm, on the other hand, the desktop client only make one query via PROPFIND to the top-level folders I select to sync and that's it, it doesn't query every subfolder inside those...

  6. llucax commented on Apr 18, 2015

    @llucax
    Author

    Even more, the android client makes 2 PROPFIND query per folder, not just only one!

  7. masensio commented on Apr 22, 2015

    @masensio

    Hi @llucax,

    thanks for reporting your problems.
    We haven't done changes in sync process since 1.6.1 version ( This version fix #671 ).
    Have you enabled automatic sync in Account Manager of the device? If you have this option enabled and you have a lot of folders ( 4K folders is a lot I think ) sync process takes a lot of time.

    Mobile sync process only takes the data about the directories tree and the content of each folder. If you need to have the content of a file or a folder you need to download specifically. We make two PROPFIND in order to obtain the files/folder and the share files/folders, but that isn't the cause of the battery problems.

    So our sync process works in different way than the desktop sync process.
    We know that we can do some improvements in our sync process, but I don't know when. It is not planned in the near future. 😟

    Sorry for the inconvenience.

  8. leandro-lucarella-sociomantic commented on Apr 22, 2015

    @leandro-lucarella-sociomantic

    hi @masensio, thanks for the reply. Yes, the battery drain occurs only when Sync is enabled in the device and in particular when I enable the OwnCloud sync account.

    So, this effectively leaves me without owncloud sync in my phone. What do you think about adding some option to pick which folders to sync, like in the desktop client. I have the feeling that might be easier to implement than changing how the whole sync process works...

  9. masensio commented on Apr 22, 2015

    @masensio

    Yes @llucax we have in mind to have "Keep in sync" option for folders also, see #3
    I hope it will be available in a near future.

  10. leandro-lucarella-sociomantic commented on Apr 22, 2015

    @leandro-lucarella-sociomantic

    Yes @llucax we have in mind to have "Keep in sync" option for folders also, see #3
    I hope it will be available in a near future.

    No, I mean the exact opposite, to be able to tell the android client to absolutely ignore some folders. In the desktop client is the other way around, instead of having automatic access to the root directory, you set up which folders you want to sync to. So, I have like 3 top-level folders. 1 that is he only one is important to me to be accessible in the phone and with just a few files, and 2 that have a big number of subfolders. If I could tell the android client to only look at that small subfolder, that would let me use the owncloud client in android, which now for me is absolutely not an option.

  11. masensio commented on Apr 24, 2015

    @masensio

    Hi @llucax,

    sorry for my confusion. In that case, please open a new issue describing the new feature, to keep in mind for the future enhancements.

    At the moment, we have in mind the favorite folders feature not the option that you want. So, I don't know when this new feature could be included in our app.

    Thanks in advance.

  12. leandro-lucarella-sociomantic commented on Apr 24, 2015

    @leandro-lucarella-sociomantic

    Done, #960. Thanks.

  13. jab416171 commented on Jun 20, 2015

    @jab416171

    I'm having the same problem. This app has been killing my battery over the last couple of days. I turned off sync in the account manager, so hopefully that will fix it until it's fixed in the app itself.

  14. 2 remaining items

  15. llucax commented on Jun 24, 2015

    @llucax
    Author

    I can confirm they sync process keeps query folders that didn't change all the time. I had to disable it again.

  16. davivel commented on Jun 25, 2015

    @davivel
    Contributor

    Sorry for insisting, but: does it query for those folders once or twice?

    EDIT: by the way, even if it's once, its obvious there is a problem. Don't need you retest, thanks.

  17. llucax commented on Jun 25, 2015

    @llucax
    Author

    It does check twice per folder as said in #953 (comment), this is each time a sync is performed, 2 PROPFIND are made against each folder.

  18. llucax commented on Jun 25, 2015

    @llucax
    Author

    But according to the web server logs, the reply is different for each (different size at least).

  19. davivel commented on Jun 25, 2015

    @davivel
    Contributor

    Yes, that's expected. The first one is requesting only for an Etag. The second one is the full list of files in the folder, and should happen only if the Etag changed since the previous sync.

    And we need to change this. A single request should be triggered per-folder, using a conditional header with the last Etag to get a response only if the Etag changed.

    Technical debt.

  20. llucax commented on Jun 25, 2015

    @llucax
    Author

    Technical debt.

    "let him who is without technical debt cast the first stone" :)

  21. davivel commented on Jun 26, 2015

    @davivel
    Contributor

    XD

  22. m4lvin commented on Dec 9, 2015

    @m4lvin

    Was something changed recently which can bring back this issue? I never had this problem before but now owncloud is emptying my battery... (app version 1.9.0 from f-droid, Android 5.1.1 on Nexus 4, owncloud 8.2.1 on server)

  23. kricklen commented on Jan 17, 2016

    @kricklen

    I got the same problem, the owncloud app keeps requesting the same external folder infos from my server v8.2.2, though the content didn't change for months. This seemed to start with app v1.9.0.
    The desktop v2.1.0 seems to work fine.
    Is this still being investigated?

  24. ghost closed this as completedon Apr 26, 2016
  25. llucax commented on Apr 27, 2016

    @llucax
    Author

    I can confirm this is much better, but with sync enabled, the owncloud app still hammers the server quite a bit, even for folders that didn't change in ages. Should I open another issue or reopen this one?

  26. llucax commented on Apr 28, 2016

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions