What is the 'mdworker' Process on Mac
If you have ever taken a proper look at your Mac's Activity Monitor then you may have noticed many unrecognizable processes and applications. Most of these are part of your operating system, or are utilities that macOS relies on. One of the common Mac processes that users try to find more information for is mdworker. It may often be accompanied by a child process called mds. Sometimes, users complain that these mdworker is taking too much CPU resources, and they are wondering how to fix this, or even if it is safe to end the process temporarily.
Mdworker, short for metadata server worker, is a process part of the Spotlight utility. It is meant to index files, and make sure that your Mac's Spotlight works as quickly as possible. If it is consuming too much CPU resources, then it is likely that Spotlight is currently rebuilding its index. Do not worry though, Spotlight will free up resources automatically if you try to run heavy software, and mdworker will delay its tasks for later.
Reduce Mdworker's CPU Usage
Since you should not stop this process, you may want to consider rebuilding Spotlight's database manually, therefore controlling when mdworker uses resources. To do it manually, you need to go to Applications -> Utilities -> Terminal and enter the command sudo mdutil –E /.