Excessive data consumption for "Documents & Sync" and constantly high CPU load on iPhone and iPad

Discussion in 'iOS 11' started by aicicorn, Jul 13, 2018.

  1. aicicorn macrumors newbie

    Jul 13, 2018

    some weeks ago I noticed that my iPhone 6 was using the battery capacity in no time (from 100 to 1% in 4 hours) in addition to using all of my cellular data plan (10Gb). When i looked at the statistic page in settings it became clear that the background iCloud function for "Documents & Sync" was using all the cellular data.

    Before this happened, I installed the iOS 12 public beta on both the iPhone and iPad. Since the problems got really bad I rolled back to iOS 11 on all devices but the problem persisted. I deleted everything from the icloud storage I could on my Mac resp. online.

    After installing the xCode tools I was able to read the CPU utilization and down/up load speeds when the devices are signed into the icloud account:

    - two processes "securityd" and "cloudd" were using almost the entire cpu capacity without any sign of short term behavior

    - constant download from an icloud server to the device of approximately 30-60 MB a minute

    The only way to use my phone/pad again was to sign out of the icloud account on the devices. I tried to sign in into an old Me account to see if it is a device or server problem. With the old account signed it the phone behave completely normal. No sign of excessive CPU or data consumption.

    Apple Support said that I should just wait a few days, but no sign of improvement so far.

    Does somebody else have a similar problem? I assume it's a server or cloud SW issue, but maybe one of you have been in a similar situation and got it resolved either through actions on the device or on the backend.

    Please let me know and thanks for your help.
  2. cynics macrumors G4

    Jan 8, 2012
    Narrow down the issue. More then likely this is 'sync' not 'documents'. Goto Settings > Apple ID > iCloud > Manage Storage. The item at the top of the list is the likely culprit. There is a good chance it will be Photos and if so back out and...

    Goto Settings > Photos....

    Is iCloud Photo Library turned on?
    Under that do you have checked? Optimize iPhone Storage or Download and Keep Originals?
    Below that is Upload to My Photo Stream on or off?
    Nearing the bottom tap Cellular Data. Is Cellular Data and/or Unlimited Updates turned toggled on?

    Personally I recommend using "Optimize iPhone/iPad Storage" selected and on a Mac use "Download and Keep Originals" for safe keeping.
    Turn My Photo Stream off.
    Have Cellular Data on but Unlimited Updates turned off.

    I use the above because Optimizing iPhone/iPad Storage saves other devices from having to download the full version of photos needlessly however you have the full version in iCloud and locally on your Mac. Turn My Photo Stream off because iCloud Photo Library does most of what its doing plus more anyway. And keep Cellular on so you are able to download photos on other devices by clicking on them, with Unlimited Updates off to keep usage from becoming excessive.

    Doing the above will reduce usage in relatively short order (still be patient though). However if Photos isn't the issue or you don't use iCloud Photo Library than go through the other items in iCloud Storage sections of settings to look for excessive usage. I mentioned all the above because its typically Photos trying to sync a massive library.
  3. chrfr, Jul 13, 2018
    Last edited: Jul 13, 2018

    chrfr macrumors 604

    Jul 11, 2009
    I'm having the exact same problem. I also see issues with my iCloud keychain on Macs signed into the same account. Things like Safari passwords stop working and wifi networks don't sync between devices. My phone has used over 20GB of data under "Documents & Sync" in the past 3 weeks.
    I called Apple about it and did not get any resolution.
    I do notice that the problem (at least the Mac part of the problem) only happens if I have 2-factor authentication enabled. When I turn off 2-factor for my iCloud account, everything behaves normally, but several features don't work without 2-factor being enabled. The problem also does not affect Macs using 10.11.6 or 10.12.6 so it seems to have something to do with new features that got added in iOS 11/macOS 10.13.
    --- Post Merged, Jul 13, 2018 ---
    It's not photos. Photos shows as its own data usage in the cellular stats.
  4. cynics macrumors G4

    Jan 8, 2012
    Photos and iCloud Photo Library aren't one in the same.

    For example if you turn off cellular data to Photos the Photos app wont download new photos on cellular and it wont be able to get the full res version of an image. However if you add a new photo to photos it will still sync to iCloud using data. This is why its two separate cellular settings.

    This is how I use to use an iPad I had with a very limited data plan.
  5. chrfr macrumors 604

    Jul 11, 2009
    This particular issue is distinctly a problem related to keychain, not photos. It's easily seen by looking at log files.
  6. cynics macrumors G4

    Jan 8, 2012
    If that’s the case what I’ve found successful (iPhone stopped syncing passwords) was to log out and back in of iCloud however in retrospect I found that to be such a pain that next time I’ll likely restore the iPhone.

    Although my issue didn’t end there. I had to manually remove my iPhone at iCloud.com. Only then did everything work normally again. Although I did not have an issue with excessive data usage just keychain not syncing and possible higher than average CPU activity since I had lower battery life.

    If that doesn’t work than resetting network or keychain (ugh) maybe in order.
  7. chrfr macrumors 604

    Jul 11, 2009
    I went through all the steps of removing all the devices and resetting networks. The iCloud Keychain, when 2-factor authentication is enabled, contains a lot more than just data like logins and passwords and Apple doesn’t document what that is nor do they provide a way to remove it all. On my Macs, the iCloud Keychain database, which would normally be about 10 MB or less grows to nearly 500 MB.
  8. cynics macrumors G4

    Jan 8, 2012
    How are seeing storage space used by iCloud keychain? Keychain Access will show you everything in the database you can also use a security dump in terminal to see the contents of the login keychain (not iCloud unfortunately though).

    Turning keychain off on all your devices should remove keychain. However you can also goto Keychain Access > Preferences > Reset My Default Keychains. This will create new default keychains (Login and iCloud) wiping out the old stuff.

    Screen Shot 2018-07-14 at 9.37.03 AM.png
  9. chrfr macrumors 604

    Jul 11, 2009
    It's in /Username/Library/Keychains. It's a SQLite database and my iCloud Keychain database has over 30,000 lines of data being written to it and whatever this data is remains invisible to Keychain Access. This data is related to something called "Manatee" which must be an internal name for something that syncs between macOS 10.13.x computers and iOS 11.x devices.
    The security binary doesn't work on iCloud Keychains so it's irrelevant to this.

    Resetting the keychains does not solve this problem, nor does logging all computers out.
  10. dstone macrumors newbie

    Aug 6, 2018

    I have been having the same issues for the last 3 months, however, mine started when I installed the 11.4 beta. My phone battery would drain extremely fast and it would be hot all the time. It is doing this on any devices that uses my Apple ID. I realized it was constantly syncing data via cellular and wifi. The last couple months I have chewed through out 180gb of cellular each month and I'm sure about 600gb/month for my ISP because as a house, we have been using about 1.5TB

    I have tried wiping my phone, getting a new phone, but nothing works. As soon as the store employee had me sign into iCloud with the new phone, it started churning out huge amounts of data, all in Documents & Sync, under System Services. Apple supposedly has the level 2 engineers looking into this, but I've heard nothing in a month. If I use my Apple ID to sign in to iCloud on a device running 11.3, all is fine. If I sign out of my devices, leave the data such as contacts, reminders and notes, everything is fine since I'm not in iCloud. If I sign in using a new Apple ID, the data issues comes back.

    I thought the problem was with reminders, so I wiped all out and recreated lists and reminders and used a new Apple ID. All seemed fine for about a day. Then, because I was have having some connectivity issues, I reset network settings. I don't know if it was that or a coincidence, but the phone started chewing through huge amounts of data.

    The only thing that "solves" my problem is moving to the iOS 12 beta. however, while it stops the data flow from Documents & Sync, my entire system becomes unusable. Apps stop working. they either don't launch at all or they crash. I cannot access the App Store. My settings menu becomes very slow and I cannot access iCloud info from settings. It just hangs until it crashes. If I try and circumvent iCloud and go through accounts in order to sign out of iCloud, I can hit Sign Out, but nothing happens. The only thing I can do, is go in DFU mode and restore the entire device back to 11.4 and try something new. I'm running iOS 12 beta on my iPad, but I do not have these usability issues. It's a little buggy, but it's much better than on my iPhone X.

    Currently, my phone is on iOS 12 but I'm not signed into iCloud, so everything is fine. However, this is not a good solution. I would be happy to communicate offline in more detail if you think it would help our problems. Any insight you can provide will be so appreciated because I'm at my wits end!
  11. chrfr macrumors 604

    Jul 11, 2009
    I ran across a blog post today that may resolve this problem. I've signed 2 Macs and an iPod Touch in and out a couple of times so far after doing these steps and things seem to be working. I'll gradually add my other devices back in over the next day or so to see how they do.
    The blog post is here: http://krypted.com/cloud/reset-connections-applepay-health-ckksctl/
    Because I was not concerned about preserving data in the account, I skipped right to
    /usr/sbin/ckksctl reset-cloudkit
    and then signed my Mac out and back into the problematic iCloud account. After doing this, my iCloud Keychain database went from the >400MB to a more normal 13MB and things seem to be syncing between devices successfully, and my Safari passwords are autofilling as expected.
  12. dstone macrumors newbie

    Aug 6, 2018
    Interesting, however, this is a little over my head. What kind of data would not be preserved?

    Once doing this on my Mac, would I then try to login into let’s say my iPhone iPad with the problem account?

    Obviously, I’m on iOS 12 on my devices, so the data leak is plugged. I guess I can roll it back to 11.4, but what pain ;)

    However, if this fixes my issues and I can actually go back to my original Apple ID, I would be very happy.
  13. chrfr macrumors 604

    Jul 11, 2009
    I have no idea what might or might not be wiped by this reset. My problem seemed to persist with the iOS 12 and Mojave betas so we may not have the same exact problem. I’d be concerned that things like health and activity data may be removed.
  14. dstone macrumors newbie

    Aug 6, 2018

    Have you figured anything out yet? I can’t figure anything out. I tried my original Apple ID )that had the data leak on 11.4) on iOS 12 bc the data was fine on that. However, yesterday when I signed in, in started chewing data. I’m very confused!
  15. chrfr macrumors 604

    Jul 11, 2009
    I ran the command I posted in post #11 in this thread and have had no further problems with my account. Have you tried that?
  16. dstone macrumors newbie

    Aug 6, 2018
    This code?
    /usr/sbin/ckksctl reset-cloudkit

    I have not tried it, b/c I was concerned about losing data. However, I have health/activity exported so I can certainly try it. Currently, I have Keychain off for my iCloud accounts, but this hasn’t stopped the data flow.

    I assume I just have to be logged into my computer/iCloud with the affected Apple ID before I run this. Since it’s my iPhone and iPad that have had this issue, how will running this code on my computer help? Unless of course my computer is chewing through data as well, but I don’t realize it. If it is, this couple be why I having been chewing through 1.5 - 2.0 TB of data on my ISP.

    Thanks again for your thoughts!
  17. chrfr macrumors 604

    Jul 11, 2009
    Yes, that command, and yes your computer has to be signed into the problem account because you're resetting the cloud data for the account.
    My computers, including my iOS devices, were not properly syncing something in the iCloud Keychain. Running that code on your computer resets the data that's saved in the cloud which should get rid of whatever data is corrupt and repeatedly syncing. Refer to the link in post #11 for more detail.
    If you look in the folder /yourusername/Library/Keychains, you should see a folder named something like EC0B3947-AC4F-5853-AD4E-AEE5B68B3DA1. Open that folder and look for the file named keychain-2.db. When my devices were burning through data, that file was around 400-500MB. Normally the file should be much smaller, in the 10s of MB. How big is the file in your computer?
  18. dstone macrumors newbie

    Aug 6, 2018
    In my folder, I have three keychain files...

    keychain-2.db is 1.21gb

    keychain-2.db-shm is 2.3mb

    keychain-2.db-wal is 181kb
  19. chrfr macrumors 604

    Jul 11, 2009
    Ok, then yeah, you have the same problem I did. You should be able to fix it with the ckksctl reset.
  20. dstone macrumors newbie

    Aug 6, 2018
    Ok, I'll run it now. However, aside from my iMac, should I be logged in or out of the affected account on my other devices?
  21. chrfr macrumors 604

    Jul 11, 2009
    I don't remember whether I was logged in or not.
  22. dstone macrumors newbie

    Aug 6, 2018
    I want to make sure I do this correct. Which of these should I use? I'm assuming that even though the file is very large on my computer, it's the cloud that is corrupted, correct?

    Now, let’s force a pull of what’s in iCloud using the fetch verb:

    /usr/sbin/ckksctl fetch

    A successful sync will simply exit. However, that doesn’t mean that the keys are actually working. So if the issues persist, what we’re going to do is reset what’s in the local system and then pull the information from CloudKit again and show the status:

    /usr/sbin/ckksctl reset; /usr/sbin/ckksctl status

    Additionally, if you feel the local system is correct and the CloudKit data is incorrect then you could do the opposite and push a fresh config from the client to CloudKit:

    /usr/sbin/ckksctl reset-cloudkit; /usr/sbin/ckksctl status
  23. chrfr macrumors 604

    Jul 11, 2009
    Use the reset-cloudkit command, as I said in post 11.
  24. dstone macrumors newbie

    Aug 6, 2018
    Good morning. I ran the code yesterday and it brought down the file size from 1gb to 10mb. My phone worked normally all day and did not appear to be syncing large amounts of data. It also operated perfectly, no apps hung or crashed, I was able to get into iCloud settings and all my iMessages sent without any issues. I even managed to set up ApplePay Cash without any problems. Before the reset, I was unable to get it to setup. Last night before I fell asleep, I started an iCloud backup. When I woke this morning, it hadn't finished, which is very odd. I cancelled the backup. Not sure if this has anything to do with it, but when I went to check the keychain size, it had balooned from 10mb to 922mb. Also, my phone seemed to be acting a little buggy at one point. I ran the cloud-kit command again as well as the command to reset the local. I logged out and back into iCloud again on both my Mac and my phone.the file size is down to 24mb. I will try another iCloud backup and see if that has an effect on the file size. Maybe something else is going on.

    Side note, do you know of any good way to track WiFi data usage? I would like to see if my phone and/or iPad are consuming data.

    Thanks again for your help.
  25. dstone macrumors newbie

    Aug 6, 2018
    So far, so good! It’s been three full days and my phone is back to normal. Data usage has been fine and no glitches with iOS 12. The keychain size has maintained 38.4mb for the past couple days (It started out at 24mb).

    I’m a little hesitant to upgrade to the latest beta versions now that everything seems fine. All I need is for an update to screw-in it all up again.

    Thanks again for your help.

Share This Page