There are various processes running on various Operating System to complete the work assigned to them. All of these processes are different and have different functions. Likewise is the md and the mdworker process in Mac OS. They are assigned on Mac OS for performing a certain amount of roles which can be seen in the Spotlight every time you copy and paste a few files. So in this article, I would explain in detail about the mdworker process in Mac OS and also answer, why md worker has 60% CPU usage sometimes?
What is mdworker on Mac?
MetaData Server Worker is the full form of mdworker and it is a process used for the search engine Spotlight on MacOS. The md of the mdworker i.e. the MetaData Server helps in managing the index which provides the users with quick search results while the mdworker i.e. MetaData Server Worker makes the quick searching possible by indexing the files.
What is the mdworker process?
The mdworker process is nothing but the mdworker itself in a form of process that runs on all the Mac devices to help to create the index with quick search results for users. Like whenever you download files or copy files from one storage place to the other or from your Pendrive to your Mac then when these files are copied and pasted, the mdworker process works with high CPU usage to create an index for these files (Folder location) which can be referred by users whenever they want.
Why does it run?
As explained already, whenever any new files are created on the system or any files are copy-pasted then the mdworker starts working. It would create an index for all the files that are been pasted and remove the index of all those files that do not exist at the same location anymore.
The mdworker has to run for compulsory otherwise there would be no proper indexing of files and as a result, the files would never be at the location where the user kept it. This is why mdworker has to keep running whenever the Mac is ON.
Mdworker Taking huge Memory?
It is okay if it takes huge memory space and slows down the pc because that is temporary. It only uses huge amount of memory whenever new index files have to be created i.e. a large number of files are being added or removed. So, only till the files are being pasted till that time the mdworker would use a huge amount of memory and once the work is done, it would decrease the usage gradually back to normal. It would all be a matter of a few minutes and the system will be normal as it was before. Though if you feel that the system has become slower than before then you may refer the next point.
How to Disable mdworker using Spotlight
I would not recommend you to do this if you have recently added some new files on your system. Though disabling the mdworker is no harm but it would stop the indexing that is going on and it would continue back again once the mdworker process is enabled again. So, if you still want to disable the mdworker process then you would need to disable the Spotlight, since, mdworker is the part of Spotlight.
- Open the terminal on the Mac and type the commands below.
- Type or copy-paste
sudo nano /etc/hostconfigand press Enter key.
- Then using arrow keys, find the
- Now, change the above
- To save the changes, press Ctrl + O key, and press Enter/Return key.
- Now, press Ctrl + X keys to exit the
- This command will disable the spotlight,
mdutil -i off /.
- Now, enter the command
mdutil -E /to delete all the Spotlight index.
- Finally, reboot your Mac to make changes effective.
This will disable the Spotlight and you can see that now your system might be running fine. But still, you would need to re-enable the spotlight back in future and to do so just enter the below commands.
- Change back the entry
SPOTLIGHT=-YES-and press save.
- Also, enter the command
mdutil -i on /and press enter.
After this restart, your system and the Spotlight will be enabled again. And if this time, if it slows down your pc again, have some patience and let it complete its task. Because as I said above, the mdworker occupies large memory space for a short period of time and after it’s work is done, the memory usage decreases back to normal.
You can also open spotlight and prevent spotlight from searching a few locations by going to the privacy tab and adding the file locations you don’t want Spotlight to search or create new index there. This might sometimes decrease the memory usage of Spotlight and make your pc run faster.
mdworker and mdworker process are both the same, it is just that mdworker is an idea and the mdworker process is the practical explanation of that idea. mdworker stands for MetaData Server Worker and is used to index the files for better search results. It is a part of the Spotlight and enabling or disabling mdworker could be done by enabling or disabling the Spotlight itself.
So in this article, I have explained what is mdworker? why is it used? why mdworker occupies large memory space? and how to disable mdworker? Explaining all this would make things clear for you about mdworker process and though if you still feel you need to know about something that I missed then comment below and let me know.