You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Time Machine and kernel_task transferring large amounts of data

macOS 11.5.1

Synology NAS DS213+ running DSM 6.2.4-25556


OK, so I don't know if this is an issue with macOS or Synology NAS but I'll ask here and again in the Synology forums - I have upgraded operating systems on both recently.


I do Time Machine backups to a NAS and I use the NAS only for Time Machine backups.


Currently the NAS has 2 x 4 TB HDDs (both less than a year old) set up as a single RAID volume - the useable space on this volume is about 3.7 TB with around 60% (2.22 TB) used, the remainder free.


Some months ago, I don't recall exactly when, I noticed that Time Machine backups, even small incremental backups seemed to be taking a very long time. Investigating further, and watching Activity Monitor, this seems to be associated with kernel_task.


I have just now watched, on Activity Monitor, Time Machine do a 156 MB incremental backup. As Time Machine started preparing the backup, kernel_task kicked in. Time Machine, from the icon in the menu bar seemed to think it had finished the backup within a few minutes.


However, kernel_task kept running. When I checked the Synology NAS, Time Machine was still logged in as a user. Activity Monitor shows kernel_task as having sent 618 MB and received 8.6 GB (!) over the network and read/written 2.69 GB/2.61 GB to the internal HDD. However, kernel_task isn't taking much CPU time - kernel_task was taking about 2% of CPU time.


I read that one of the commoner reasons for kernel_task running a lot is to control CPU usesage, to ensure the CPU doesn't overheat. Well, while this Time Machine incremental backup was running, the PECI CPU temperature was only 47 ºC and the fans were not running hard (iStatistica sensors).


My concerns are:


  1. While all this is going on, my LAN is slowed down.
  2. Repeated reading/writing of large amounts of data to the NAS HDDs is going to significantly shorten their lifetime.


Ideas and suggestions please 😊

iMac 21.5″, macOS 11.5

Posted on Aug 10, 2021 2:13 AM

Reply
Question marked as Top-ranking reply

Posted on Aug 21, 2021 6:28 AM

Solved 😀


Having decided to give it one more try to get Time Machine working properly, I looked up the instructions from Synology for backing up from Time Machine to a Synology NAS.


I've previously done a complete new Time Machine backup to the NAS, about 6 - 8 weeks ago, deleting all the existing Time Machine files, which hadn't solved the problem


But then I realised that while I'd deleted all the files, I hadn't deleted the Time Machine share folder, which was originally created some years ago, perhaps even before the AFPS was introduced.


So, I deleted the Time Machine share folder and created a new share folder. Went to Time Machine and set it up to backup to the new share on the NAS.


Problem gone!


No idea what changed in a recent Big Sur or Synology DSM update to cause the problem but that doesn't worry me.

Similar questions

17 replies
Question marked as Top-ranking reply

Aug 21, 2021 6:28 AM in response to larry666

Solved 😀


Having decided to give it one more try to get Time Machine working properly, I looked up the instructions from Synology for backing up from Time Machine to a Synology NAS.


I've previously done a complete new Time Machine backup to the NAS, about 6 - 8 weeks ago, deleting all the existing Time Machine files, which hadn't solved the problem


But then I realised that while I'd deleted all the files, I hadn't deleted the Time Machine share folder, which was originally created some years ago, perhaps even before the AFPS was introduced.


So, I deleted the Time Machine share folder and created a new share folder. Went to Time Machine and set it up to backup to the new share on the NAS.


Problem gone!


No idea what changed in a recent Big Sur or Synology DSM update to cause the problem but that doesn't worry me.

Aug 21, 2021 4:38 AM in response to vmulier

The electriclight article is interesting, but there are problems involved with sparsebundle (basis of the new Time Machine approach) and also sparseimages.


I had huge problems verifying an encrypted APFS Time Machine backup on an SMB share on a NAS/Server: https://discussions.apple.com/thread/252729592?answerId=255755542022#255755542022


The whole thread centers around how unrelieable the use of sparsebundle and sparseimage has become lately. Since sparsebundle is a centerpiece of modern Time Machine on Big Sur, the problem, that crops up, is:


If it is impossible to verify the content of the physical backup on your NAS/server, how can you be sure, that this sparsebundle based backup is even valid, if - for instance - your current Mac Mini M1 decides to enter the eternal bitfields in a fried state?


I’ve found no way to verify, that the physical content (as a standalone copy) is actually a valid backup, that can be rolled back to a new Mac Mini M1 in a working and valid state.


Any ideas to verify actual content of the physical sparsebundle is welcome!


Regards


Aug 17, 2021 6:21 AM in response to larry666

Privacy tab allows you to exclude volumes or folders, but not TM mounted volumes. With the user interface, you can't select the mounted volumes as the file selection panel doesn't allow you to go to /Volumes. Even if you open a Finder window with the go to folder option and type in /Volumes, you will see the mounted TM volume but if you drag it to the Spotlight privacy panel, you get an alert stating "xxx volume is a TimeMachine Backup volume, you can't add it to the privacy list"


So, this is not an error. It's done by intent.


Regarding the full backup issue, as mentioned above, in my case the problem stopped after I switched from using a afp share to a SMB share. You can configure Synology to only share a volume with SMB and then you have to reconfigure your TM backup preference.


From what I see, and understand, the biggest part of the problem is really the spotlight indexing. The backup itself was acceptable. I monitored it by launching it manually with the command line above. But then backupd started indexing the TM volume with mds and mdworkers. And those processes are working by "reading" (i.e. downloading) files on the remote volumes and then writing indexed informations to it.


One could think it would be much more efficient to index things locally rather than remotely. But my guess is that it's, at least partly, related to apfs. Before with hfs+ there was a log of all file system changes that allowed you to clearly identify what were the modified files on your drive since last back. With apfs volumes, there's no longer this. There's a snapshot of changes at block level hence you don't directly get the list of files to backup. I think the whole TM process is more complicated as it has to rebuild a list of files and actual content to the backup volume. Until recently it couldn't just backup snapshots as apfs was not supported on TM volume because there's no hardlink in apfs as TM snapshot was using them to avoid duplicating files that did not change.


I'm not sure how it's done now:

  • TM could Backup snapshots directly but it would be tricky to manage as any missing snapshot could preclude TM from rebuilding an exact image of all files at a certain point in time
  • I don't really understand why TM now needs to index backups with Spotlight as, in the same time, it seems that Apple says they are not included in Spotlight results when you search something
  • Using apfs format on the backup volume sounds like a non-sense especially with NAS using regular HDDs that are sequential by nature vs apfs that is expecting random access for efficient file access. This alone could explain a big slowdown while indexing the backup remotely if you have to go randomly through all changes in apfs snapshots on the NAS volume
  • The previous point by itself suggest that the best way to go would be to rebuild a defragmented image of latest changed files on the backup snapshot but it still doesn't solve the hard link requirement of traditional TM snapshots
  • Because of all the above, I think it would make more sense to continue using a HFS+ format for the TM disk image bundle on a NAS but I don't know how to do this

Aug 16, 2021 7:35 AM in response to larry666

Situation remains and getting worse, if anything - no suggestions from the Synology forums either.


Additional observations:


a) As well as the usual NAS AFP user, which is how Time Machine appears, there is a CIFS users which I haven't seen before.


b) For what it's worth or not, the following appears in the system log every few seconds for the 26 mins the current Time Machine 200 Mb incremental backup has been running:


Aug 16 15:21:43 Laurences-iMac com.apple.xpc.launchd[1] (com.apple.mdworker.shared.0E000000-0700-0000-0000-000000000000[7474]): Service exited due to SIGKILL | sent by mds[90]

The italicised detail is different every time but the rest repeats.


And if I kill the AFP and CIFS connections to the NAS, this also stops.

Aug 16, 2021 7:48 AM in response to larry666

Time Machine and Spotlight (n-tuple mdworker) work together to index and backup to your RAID array on the Synology. That is a busy time for the UNIX kernel (kernel task) to handle those System and network requests, along with all the other customary Mac process requests in the operating system.


Continue to update macOS to 11.5.2, and see if there is any change, and hope for a Synology forum response that can help. Too many variables with your setup to pinpoint an issue with macOS, and your raid configuration may be a contributing factor.


I have a Synology NAS here and have never used its TBs of storage for Time Machine backup. Too much history in these communities with those with NAS configurations used for Time Machine and when things go wrong…

Aug 16, 2021 8:09 AM in response to larry666

I've got the exact same issue. Time machine activated on a Synology DS920+. I switched from afp to SMB share because I regularly was facing issues with the backup and TM asking to do a fresh full backup of my MBP internal 1TB SSD every now and then.

No problem of corrupted backup since.


But, first surprising thing is that since I updated to Big Sur every hourly snapshot could be hundred of megabytes even if I'm just having simple activity like writing mails or word documents.


Then, I realized that actual network exchanges are multi GB per hour. Investigating this, I found that after each hourly backup from TM, Spotlight start indexing (reindexing?) things on the TM share reading and writing GBs of data over the network. With a lot of mds and mdworker CPU workload. It even preclude the MBP to go to sleep with assertions saying "waiting for backupd" and "waiting for backup indexing to finish", plus diskarbitrationd (for mounting the share), etc.


I also have multi tons of "Aug 16 16:58:06 MacBook-Pro-2018 com.apple.xpc.launchd[1] (com.apple.mdworker.shared.01000000-0100-0000-0000-000000000000[17701]): Service exited due to SIGKILL | sent by mds[95]" flooding the system.log.

1 process killed every 10-15 seconds, figure!


All in all, the whole backup task is taking ~20-30 minutes at a minimum, every hour, with enough CPU activity to have fans blowing all the time and slowdowns. Not to mention that even if I don't use the laptop, the display is off due to energy saver, but the MBP is warm/hot and not sleeping at all during that time.


It's such a pain that TM that was a must have option that I always used since it's introduction is now disabled by default because I can't bear to have my MBP overheating with fans blowing will I'm just doing basic work with it (office work, not 3D games or video editing)


Please, Apple, wake up... Give us back the basic and robust functionalities we always loved with our macs and stop letting interns updating core technologies making it unusable

Aug 16, 2021 8:16 AM in response to VikingOSX

Updated to macOS 11.5.2 several days ago - no change.

Synology OS is DSM 6.2.4, the most recent.


RAID configuration is the same as I've had for a long time but the problem didn't exist until relatively recently, so I suspect a recent software update.


The only real change is that the Time Machine backup is now a lot bigger than it was say a year ago when I had no problems.


Excluded the NAS from Spotlight indexing - didn't help.


How/where would you suggest I have Time Machine backup to? I have a MacBook which I also backup to the same NAS over the LAN.

Aug 16, 2021 8:27 AM in response to vmulier

Good to hear I'm not on my own and that it is possibly a macOS/Time Machine issue :-)


I've stopped, I think, Spotlight from indexing the Time Machine backups on the NAS - no change in excess times for Time Machine backups.


Just wondering whether to also disable Time Machine and try a 3rd party backup app?


Been using Time Machine for years with no problems and just occassinally, it has saved me major problems but now it seems it just keeps churning away. And when I enter Time Machine to recover a file, it takes for ever to find it.


Aug 16, 2021 8:45 AM in response to larry666

No, you're not alone 🙂


I tried, but unfortunately you can't stop Spotlight from Indexing the backup, at least not with TM preferences. I didn't try with the command line tmutil.


I don't know for other 3rd party software la CCC or Synology own options, but what you can do is launching backups manually with command line in the Terminal.app:


tmutil startbackup


Or you can even create an automated schedule of it on a regular basis (at night for example) by creating a LaunchDaemon in your ~/Library/LaunchDaemons folder

Aug 16, 2021 9:02 AM in response to vmulier

I thought the Privacy tab for Spolight in preferences would stop it indexing but perhaps not? It just prevents those areas being searched …?


The hourly incremental Time Machine backups never used to be an issue - a 200 MB backup was done in a few minutes and everything Time Machine related just then stopped stopped. Now a 200 MB incremental backup keeps going for 30 mins or more …


Which is sort of the point - even if I do just a single daily manual backup, it isn't doing it correctly. At least, it's not doing what it used to do, takes excessive times and Time Machine remains very slow to to give me access to backup files.


Debating whether to delete everything, including backups, relating to Time Machine and start again with Time Machine, in case there's a fault somewhere, or just forget Time Machine and use something like CCC instead?


Tending towards forgetting Time Machine because some weeks back Time Machine decided a new full backup was required - which it took over 20 hours to do! Why? A full backup of my iMac and external HDD is a bit over 2 TB and previously a full back up took maybe 4 or 5 hrs.

Aug 17, 2021 2:19 AM in response to larry666

Should have realised earlier …


My wife's old MacBook running El Capitan (10.11.6) has none of these problems doing a Time Machine backup over my LAN to the same NAS.


Connects, takes a few minutes to do an incremental backup, releases the connection to the NAS and that's it - finished.


My iMac running Big Sur used to do exactly this until relatively recently - it's a recent Big Sur update which is causing the problem.


Carbon Copy Cloner here I come.


I'll check if Apple have sorted the problem when I upgrade to Monterey.

Aug 17, 2021 9:59 AM in response to larry666

FWIW. I have a Synology DS916+ and have been successfully backing up to it with Time Machine for a number of years. However, recently with macOS Big Sur, I started to notice the backups slowing done, and eventually, stopped working all together. Thinking it was specifically a Big Sur issue (especially with APFS), I updated macOS to every incremental version, but that still didn't seem to resolve this issue. What finally did was to upgrade the OS (DSM 7.0-41890) on my NAS to the latest version available and it has been "smooth sailing" since then.

Aug 17, 2021 10:05 AM in response to vmulier

To amend my previous post, I found some information about changes in TM strategy since Big Sur.

Apparently it now uses APFS file system by default. With dedicated drive directly attached, it apparently uses one full disk per mac as it's creating a dedicated TM Backup partition within the APFS container. And it seems it's able to optimize backup by copying APFS snapshots.

I'm still unclear about how things are done with network storage besides it's also using apfs filesystem but within disk image sparsebundle. I'll do some test when I have some time to see how are stored backed up files without hard links.

That said I've found some potential errors within my TM logs with file access problem from mds_shared due to sandbox rights on some files. I need to investigate if it could explain slowness and/or the bunch of killed mds_shared processes.

By the way, searching the web for information about these logs, I found this site https://eclecticlight.co/mac-problem-solving/ that has the most comprehensive information I found until now. There are very in depth reviews of TM process with a lot of details articles about internals mechanism and solutions. There are also a bunch of very useful tools the author has developed including The TimeMachineMecanic and Ulbow which is a universal log viewer that is much more practical than doing this with the log command.

They also have plenty of other articles on macOS internals and solutions on other typical issues you can face.

I strongly recommend that you have a look at it as I think it could give you some starting points about your own issue.

I hope it will help.

Aug 17, 2021 10:26 AM in response to larry666

APFS is definitely the recommended filesystem format since Big Sur. Now, in support article Apple doesn't even mention the HFS filesystem format for TM. For classical HDD it could still have some disadvantage in terms of performance due to the sequential nature of the HDD. See https://bombich.com/blog/2019/09/12/analysis-apfs-enumeration-performance-on-rotational-hard-drives from the CCC creator blog for more information.

That said, you should also check what is the filesystem format used by you TM image sparse bundle on the NAS. I would recommend to keep both the same if they are old and you created them before big sur. Big sur can still use old TM archive created previously so it's compatible with backup from previous MacOS.

But if you create a new backup from scratch in Big Sur with APFS, it will probably not be compatible with older MacOS version. It 's probably different thing between direct attached TM HDD that as a dedicated partition format that was unknown before. And network shared TM image sparse bundle that could eventually be compatible with Catalina or Mojave, as the filesystem was already existing, but that TM probably won't recognize it automatically.

I hope it could help.

Time Machine and kernel_task transferring large amounts of data

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.