Hi,
macos notoriously writes lot of data to your ssd. Most extreme system services here are 1. logd and 2. spotlight / mds
For example, leaving macos 14.5 like 1 day in use, the logd process often already wrote several tenth of gigabytes.
A usual ssd will last like 250-1000TBW (terabytes written). The crucial part for an ssd lifespan is the amount of written data. You can get these infos about your ssd using a SMART tool, e.g. smartmontools.
While Windows might be even worse in constantly writing data, macos isn’t good at all either. In my opinion, they could easily reduce the amount of data write by a lot, simply adding configuration possibilities and having a better default config.
On my mbp pro 16 m1pro, which I use since middle 2021, the total data written is 18TB. But I also don’t use a lot of spotlight, or installing system updates, which would increase the number. On the other system, my hackintosh running 10.14.6, I already have a reduced logging and disabled a lot of spotlight, there the total written data is like 4TB, this after over 5 years.
For 1.), the logd, you can drastically reduce the data written by yourself. For this, you need to edit the /etc/asl.conf file in a text editor. This is the configuration for the log daemons. Make sure to backup the original file first.
Here is my current config:
##
# configuration file for syslogd and aslmanager
##
# aslmanager logs
> /var/log/asl/Logs/aslmanager external style=lcl-b ttl=2
# authpriv messages are root/admin readable
? [= Facility authpriv] access 0 80
# remoteauth critical, alert, and emergency messages are root/admin readable
? [= Facility remoteauth] [<= Level critical] access 0 80
# broadcast emergency messages
? [= Level emergency] broadcast
# save kernel [PID 0] and launchd [PID 1] messages
#? [<= PID 1] store
# ignore "internal" facility
? [= Facility internal] ignore
# save everything from emergency to notice
#? [<= Level notice] store
? [<= Level error] store
? [= Level activity] ignore
? [= Level default] ignore
# Rules for /var/log/system.log
> system.log mode=0640 format=bsd rotate=seq compress file_max=5M all_max=50M
#? [= Sender kernel] file system.log
#? [<= Level notice] file system.log
#? [= Facility auth] [<= Level info] file system.log
#? [= Facility authpriv] [<= Level info] file system.log
? [= Sender kernel] [<= Level error] file system.log
? [<= Level error] file system.log
? [= Facility auth] [<= Level info] file system.log
? [= Facility authpriv] [<= Level info] file system.log
# Facility com.apple.alf.logging gets saved in appfirewall.log
#? [= Facility com.apple.alf.logging] file appfirewall.log file_max=5M all_max=50M
? [= Facility com.apple.alf.logging] ignore
# restart: sudo killall -HUP syslogd
The changes seem to prevent writing of any event happening. Instead, only essential logs like errors and logins will be written from now on. Keep in mind that all other stuff still seems to be logged, but not written anymore, instead kept in a memory buffer or similar.
You can look at the log entries by entering “sudo log show --last 1m” in terminal. The amount of log entries is immense. No wonder that it quickly can fill your ssd with repeating writes.
For 2), spotlight, the story is quite more difficult now.
macos prior to Big Sur allowed to modify the system partition easily. That’s why you could disable a lot of Spotlight plugins which are located in /System/Library/Spotlight, simply by moving out most of those plugins to a backup dir. For example, I don’t need archive or pdf neither coremedia scanning. By moving out these plugins, the amount of written data by spotlight while indexing is reduced heavily. Note that disabling PDFs in the spotlight options does not seem to reduce anything. I assume that still everything will be scanned then, but filtered out, so Apple still gets your full contents.
The ideal approach would be:
- Disabling not required spotlight pliugins/mdimporters
- Only leaving spotlight for third party, Mail and simple application search
- Using a much better search tool additionally like Quicksilver
I also looked for a way to disable mdimporters using launchctl or similar, but seems to be impossible… Maybe I should make a apfs snapshot of the system partition, then make it temporarily writable, remove those files, and enable write lock again? But this will be removed as soon there is a system update. I also do not know how macos likes custom snapshots of the system partition…
Any idea here?
P.S. Sadly you can’t simply disable Spotlight services completely, because even some system apps rely on it, e.g. search in Mail.app or search in System Preferences.app.