"mds" Processes - Metadata Server and Spotlight

This section describes 'mds (Metadata Server)' processes, which index files on you Mac to support the search engine, Spotlight.

What are "mds" Processes? - "mds (metadata server)" processes are created by the system app "Spotlight", which is the search engine on your Mac computer.

Spotlight has two components: a search interface provided as the search icon on the top right corner of the Finder window, background processes, "mds", "mdwrite", "mds_stores", "mdworker" that index files on you Mac.

Here is what I did about "mds" processes.

1. View "mds" processes with "ps" command.

herong$ ps -A | grep Metadata
   65 8:55.95 /System/Library/Frameworks/CoreServices.framework/Frameworks
     /Metadata.framework/Support/mds
  189 5:32.39 .../Metadata.framework/Versions/A/Support/mds_stores
  456 0:00.14 .../Metadata.framework/Versions/A/Support/mdflagwriter
  ...
 1790 0:03.31 .../Metadata.framework/Versions/A/Support/mdwrite
  ...
 6854 0:00.77 .../Metadata.framework/Versions/A/Support/mdworker
    -s mdworker-sizing -c MDSSizingWorker -m com.apple.mdworker.sizing
  ...

2. Check CPU and memory usages of "mds" processes using "top" command. They are taking a large amount of memory.

herong$ top -pid 65 ...

PID   COMMAND      %CPU TIME     #TH  #WQ  #POR MEM  PURG CMPR  PGRP PPID STATE
65    mds          0.0  08:56.08 6    3    699  40M  0B   40M   65   1    sleeping
189   mds_stores   0.0  05:32.27 3    1    89-  42M- 30M  50M   189  1    sleeping
456   mdflagwriter 0.0  00:00.13 2    2    18   164K  0B  1584K 456  1    sleeping
1790  mdwrite      0.0  00:03.30 2    2    56   968K  0B  2572K 1790 1    sleeping
6854  mdworker     0.0  00:00.77 2    1    52   384K  0B  4248K 6854 1    sleeping
...

3. If you are doing an important presentation and don't want Spotlight indexing activities to slow down your Mac computer, you can disable it with the "mdutil" command.

herong$ sudo mdutil -a -i off
/:
mdutil[63425:14345260] mdutil disabling Spotlight: /
  -> kMDConfigSearchLevelFSSearchOnly
  Indexing disabled.

4. Spotlight related commands:

mdfind   - finds files matching a given query
mdutil   - manages the metadata stores used by Spotlight
mdls     - lists the metadata attributes for the specified file
mdimport - imports file hierarchies into the metadata datastore

Table of Contents

 About This Book

 Macintosh OS (Operating System) History

 macOS Operating System

 macOS File Systems

 macOS Network Connections

System and Application Processes

 What Is a Running Process

 Use Activity Monitor on macOS

 "ps" - Process Status Command

 "top" - Display Top Processes

 "nettop" - Processes Top Network Usages

 "Finder" Process - File Browser on Mac

 "WindowServer" Process - Drawing Graphics on Screen

 "Dock" Related Processes

 "Siri" Processes - Voice Command Interpreter

"mds" Processes - Metadata Server and Spotlight

 "spindump" Processes - Dump Memory Contents

 "login" Processes - Login Window and Services

 "softwareupdate" Processes - Update System and Apps

 "TeamsUpdater" Process from Microsoft Teams

 Keychain Access - Password Manager

 Keychain Access - Certificate Manager

 Productivity Tools on macOS

 Programming Tools on macOS

 Apache Web Server on macOS

 Develop and Run Java Applications

 Full Version in PDF/EPUB