Home > Wiki Tips

What is Mdsync & How to Fix Mdsync High CPU Usage on Mac?

Updated on Tuesday, December 3, 2024

iBoysoft author Jenny Zeng

Written by

Jenny Zeng
Professional tech editor

Approved by

Jessica Shee

English

Summary: This post from iBoysoft explains what mdsync in Activity Monitor is and how to stop it from using all CPU cycles of your Mac.

What is mdsync in Activity Monitor

The macOS mdsync process will sometimes cause your CPU load to spike on Activity Monitor, rendering your Mac slow and the programs unresponsive. In this post, we'll explore what the mdsync process is and how to prevent it from consuming high CPU usage.

What is mdsync?

Mdsync, a child process of mds (metadata server), is a macOS process responsible for synchronizing metadata (information about files and folders) between Spotlight and the file system. It runs regularly to update the metadata index and ensure it reflects any changes made to the files and folder on your Mac.

You may find it active or using a high percentage of CPU during a Time Machine backup process, after your Mac is updated or connected with an external storage device, etc.

Do not panic when seeing mdsync using all CPU or most of it on Activity Monitor, as the percentage is for a single core of the CPU, not the entire CPU. Instead, check the CPU usage of your system, it represents the stress level for all processes running on the CPU.

Normally, mdsync will release the CPU resources and become idle when the metadata is synchronized. Nevertheless, if it's having issues running the task, it may continue to consume an abnormally high amount of your Mac's CPU and cause performance issues.

Share this post on your favorite platform if you find it helpful!

 

How to fix mdsync high CPU usage on Mac?

If you're dealing with the mdsync high CPU usage issue on Mac, you can try the following solutions until the process returns back to normal.

Quit the mdsync process

The first thing you should try is to unplug unnecessary external drives and restart the mdsync process. This may be helpful as you can terminate the corrupted process and give it a fresh start. Take the following steps:

  1. Launch Activity Monitor from the Applications/Utilities folder in Finder.
  2. Type mdsync in the top-right search bar.
  3. Select the mdsync process and click the ⤬ button.
  4. Click Force Quit. 
    Kill mdsync on Mac

Wait a while and monitor whether mdsync stops taking up CPU. if it doesn't work, move on to the next fix.

Boot into Safe Mode

Another way to fix high CPU usage caused by mdsync on Mac is to boot into Safe Mode. It can isolate third-party software, clear system caches, and check and repair your startup disk.

On an Intel-based Mac:

  1. Shut down your Mac.
  2. Press the power button, then immediately press and hold the Shift key until the login window appears.
  3. Log in to your Mac. (May need to do it twice.)

On an Apple Silicon Mac:

  1. Turn off your Mac.
  2. Press and hold the power button until seeing "Loading startup options."
  3. Select a volume.
  4. Press and hold the Shift key and click "Continue in Safe Mode."
  5. Log in to your Mac.

When you're in Safe Mode, you should see "Safe Boot" in the top right of the menu bar. You can open Activity Monitor to check the CPU usage of mdsync, then restart your Mac to see if the issue is gone.

Exclude the offending file or folder from Spotlight indexing

You can also use the following command to display real-time file system activities related to the macOS mdsync process in Terminal and then add it to the exclusion list for Spotlight and Time Machine (if you're using it) to resolve the issue.

  1. Open Terminal from the Applications/Utilities folder in Finder.
  2. Copy and paste the command below and press Enter.sudo fs_usage -w -f filesys mdsync
  3. Type your administrator password and hit Enter. (The password won't echo to the screen.)
  4. Check the operation and files mdsync is working with.

Now that you've found the troublesome app or folder, you can avoid Spotlight from indexing it and Time Machine from backing it up by changing the preference.

On macOS Ventura:

  1. Go to the Apple menu  > System Settings.
  2. Select "Siri & Spotlight."
  3. Scroll down and click "Spotlight Privacy."
  4. Drag and drop the offending app or folder to the blank space of the exclusion list. 
    Exclude items from being indexed by Spotlight on macOS Ventura
  5. Click Done.
  6. Select General > Time Machine.
  7. Click Options, then drag the offending item to the exclusion list.

On macOS Monterey or earlier:

  1. Go to the Apple menu  > System Preferences.
  2. Click Spotlight and select the Privacy tab.
  3. Drag and drop the offending app or folder to the blank space of the exclusion list. 
    Exclude items from Spotlight indexing on macOS Monterey
  4. Close the Spotlight window and select the "Time Machine" preference pane.
  5. Drag the offending item to the exclusion list and click Save.

Turn off Spotlight

If mdsync is still hogging the CPU resources, try disabling Spotlight and re-enabling it.

  1. Open Terminal.
  2. Run the following command to disable Spotlight.sudo mdutil -a -i off
  3. Then reenable Spotlight by executing the following command.sudo mdutil -a -i on

Spotlight will reindex everything on your Mac. This may take a while, depending on the amount of data on your hard drive. You can press Command + Space and type anything to see whether it's still indexing. If it is, you'll see a progress bar with the word "Indexing."

Uninstall antivirus programs, security apps, and VPN

Some users have managed to fix the problem by uninstalling the antivirus software, VPN, security software, and other unwanted apps from Mac. You can also give it a try. Just know that dragging the apps to Trash will not fully remove them, as files and folders generated by the app aren't deleted that way.

It's best to completely uninstall the apps by using iBoysoft MagicMenu. Once it is installed, you can easily remove any third-party app by right-clicking and selecting "Uninstall" in your Applications folder.

Uninstall apps on Mac

The app offers a 7-day free trial, so you should be able to uninstall these apps without spending a cent. Click the button below to get it for free.

Share these solutions to benefit your fellow Mac users!

 

Final thoughts

This article discusses the meaning of the mdsync process on Mac and helps you troubleshoot the mdsync high CPU usage issue. If you have more information about this process or solutions that are not covered in this post, please feel free to share them in the comments below.

If you're also interested in other processes related to Spotlight, check the following articles: