The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,432 other followers

Spotlight taking 200% CPU

Posted by jpluimers on 2021/04/19

First I thought this was about using 4K resolution and chrome, but later I realized that it wasn’t just Chrome disliking high resolutions Spotlight was using a tremendous amount of CPU, not just while Chrome was running:

This pointed me at the culprit in sudo su - shell:

# fs_usage -w -f filesys mdworker | egrep "open"
12:15:58.892425  open              F=3        (R_____)  /Library/Application Support/Fortinet/FortiClient/conf/epctrl.plist                                                                                                   0.000072   mdworker.5397591
12:15:58.892455  open              F=7        (R_____)  /Users/jeroenp/Library/Application Support/Google/Chrome/Local State                                                                                                  0.000129   mdworker.4288698
12:15:58.892974  open              F=9        (R_____)  /Users/jeroenp/Library/Application Support/Google/Chrome/Default/Preferences                                                                                          0.000098   mdworker.4291263
12:15:58.895614  open                   [  2] (R_____)  /Library/Application Support/Fortinet/FortiClient/conf/.DS_Store                                                                                                      0.000011   mdworker.5397591
12:15:58.895860  open              F=4        (R_____)  /Users/jeroenp/Library/Application Support/Google/Chrome/Default/History-journal                                                                                      0.000099   mdworker.5324557
12:15:58.896233  open              F=3        (R_____)  /Library/Application Support/Fortinet/FortiClient/Logs/epctrl.log                                                                                                     0.000056   mdworker.5446394
12:15:58.896885  open                   [  2] (R_____)  /Users/jeroenp/Library/Application Support/Google/Chrome/Default/.DS_Store                                                                                            0.000011   mdworker.5324557
12:15:59.142579  open                   [  2] (R_____)  /Users/jeroenp/Library/Application Support/Google/Chrome/Default/.DS_Store                                                                                            0.000009   mdworker.4291263
12:15:59.394479  open                   [  2] (R_____)  /Library/Application Support/Fortinet/FortiClient/Logs/.DS_Store                                                                                                      0.000013   mdworker.5446394
12:16:06.892067  open              F=9        (R_____)  /Users/jeroenp/Library/Application Support/Google/Chrome/Default/IndexedDB/https_docs.google.com_0.indexeddb.leveldb/LOG                                              0.000129   mdworker.4291263
12:16:06.892206  open              F=7        (R_____)  /Users/jeroenp/Library/Application Support/Google/Chrome/Default/IndexedDB/https_docs.google.com_0.indexeddb.leveldb/LOG.old                                          0.000299   mdworker.4288698
12:16:06.901329  open                   [  2] (R_____)  /Users/jeroenp/Library/Application Support/Google/Chrome/Default/IndexedDB/https_docs.google.com_0.indexeddb.leveldb/Contents>>>>>>>>>>>>>>>>>>>>>>>>>>>              0.000021   mdworker.4291263
12:16:06.902343  open                   [  2] (R_____)  /Users/jeroenp/Library/Application Support/Google/Chrome/Default/IndexedDB/https_docs.google.com_0.indexeddb.leveldb/.DS_Store                                        0.000008   mdworker.4291263
12:16:07.041993  open                   [  2] (R_____)  /Users/jeroenp/Library/Application Support/Google/Chrome/Default/IndexedDB/https_docs.google.com_0.indexeddb.leveldb/Contents>>>>>>>>>>>>>>>>>>>>>>>>>>>              0.000009   mdworker.4288698
12:16:07.043009  open                   [  2] (R_____)  /Users/jeroenp/Library/Application Support/Google/Chrome/Default/IndexedDB/https_docs.google.com_0.indexeddb.leveldb/.DS_Store                                        0.000015   mdworker.4288698
^C
# fs_usage -w -f filesys Spotlight | egrep "open"
12:28:25.042434  open              F=23       (R_____)  /Users/jeroenp/Library/Caches/com.apple.Spotlight/fsCachedData/BA6E71AE-0786-4535-B6A9-781EA2D36244                                                                   0.000048   Spotlight.5497130
12:28:25.051469  open              F=23       (R_____)  /Users/jeroenp/Library/Caches/com.apple.Spotlight/fsCachedData/48E800C3-7F85-4ED8-AC8C-C8E20C087DF2                                                                   0.000050   Spotlight.5497131
12:28:25.062335  open              F=23       (R_____)  /Users/jeroenp/Library/Caches/com.apple.Spotlight/fsCachedData/605E9CDA-58CE-4024-A193-EA8BE63D0BA4                                                                   0.000035   Spotlight.5497159
12:28:25.071471  open              F=23       (R_____)  /Users/jeroenp/Library/Caches/com.apple.Spotlight/fsCachedData/F93201ED-40C5-4255-8A84-2B6F22D22556                                                                   0.000032   Spotlight.5497132
12:28:25.073362  open              F=23       (R_____)  /Users/jeroenp/Library/Caches/com.apple.Spotlight/fsCachedData/A7BB4DCC-F9C4-4B65-BC1C-80A0D2F9AFAA                                                                   0.000022   Spotlight.5497183
12:28:25.172644  open              F=23       (R_____)  /Users/jeroenp/Library/Caches/com.apple.Spotlight/fsCachedData/AFC8C2B0-1D5E-496E-AF5E-B6D346D06586                                                                   0.000042   Spotlight.5497161
12:28:25.224485  open              F=23       (R_____)  /System/Library/CoreServices/Finder.app/Contents/PkgInfo                                                                                                              0.000037   Spotlight.4189
12:28:25.243310  open              F=23       (R_____)  /Users/jeroenp/Library/Caches/GeoServices/ActiveTileGroup.pbd                                                                                                         0.000065   Spotlight.4189
12:28:25.253612  open              F=23       (R_____)  /Users/jeroenp/Library/Caches/GeoServices/Resources/default-search-3836.styl                                                                                          0.000010   Spotlight.4189
12:28:25.253906  open              F=23       (R_____)  /Users/jeroenp/Library/Caches/GeoServices/Resources/LocalizationStyleAttributes-4.plist                                                                               0.000009   Spotlight.4189
12:28:25.257810  open              F=23       (R_____)  /Users/jeroenp/Library/Caches/GeoServices/Resources/default-icons-478.iconpack                                                                                        0.000009   Spotlight.4189
12:28:25.260234  open              F=23       (R_____)  /Users/jeroenp/Library/Caches/GeoServices/Resources/default-search-icons-248.iconpack                                                                                 0.000009   Spotlight.4189
12:28:25.261674  open              F=23       (R_____)  /Users/jeroenp/Library/Caches/GeoServices/RegionalResources                                                                                                           0.000013   Spotlight.4189
12:28:25.269088  open              F=23       (R_____)  /Users/jeroenp/Library/Caches/GeoServices/RegionalResources/18-23-6-pennsylvania-transit-icons-3.iconpack                                                             0.000011   Spotlight.4189
12:28:25.269520  open              F=23       (R_____)  /Users/jeroenp/Library/Caches/GeoServices/RegionalResources/32-21-6-london-transit-icons-40.iconpack                                                                  0.000009   Spotlight.4189
^C

So after doing a bit more research, I have this in the same shell:

# defaults read /Volumes/Macintosh\ HD/.Spotlight-V100/VolumeConfiguration.plist Exclusions
(
    "/Library/Caches",
    "/Users/jeroenp/Library/Application Support/Fortinet/FortiClient",
    "/Users/jeroenp/Library/Application Support/Google/Chrome/Default/IndexedDB",
    "/Users/jeroenp/Library/Application Support/Google/Chrome/Default/Local Storage",
    "/Users/jeroenp/Library/Caches"
)

In the Spotlight configuration, this looks far less descriptive:

Fingers crossed this works better now…

Related

The ~/Library folder: you cannot browse to it directly in finder, but you can “GO” to it from the Finder main menu (Shift-Command-G), then add it as favourite (see [WayBack] How can I remove Library from Spotlight s… – Apple Community).

Keywords (links for commands to man pages at ss64.com/osx/; for system processes, explanation and links to [WayBack] Die Systemprozesse von macOS Sierra | Mac & i):

In case I need these links again to further investigate:

–jeroen

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

 
%d bloggers like this: