A list of tweaks/fixes to try to fix excessively high writes on M1
Originally all suggested by me in ssd swap - high usage of Terabytes Written, doing these has reduced my M1 daily SSD write from ranges of 350-500GB to 25-50GB, while maintaining the same heavy workflows and not losing any functionality.
These are ordered by most effective in reducing writes, so it's a good order to try them in.
The following is written by @telo123
For those of who use Facebook Messenger, Microsoft Teams, or Discord, I suggest using the Web App on any Chromium browser and save it as an app. When you add them as web apps, they will run natively. There are only few things that are missing on the Web App compared to the Desktop App, but the battery, RAM, and performance are more efficient on the Web App. Use this until these Apps are updated to run natively.
Originally all suggested by me in ssd swap - high usage of Terabytes Written, doing these has reduced my M1 daily SSD write from ranges of 350-500GB to 25-50GB, while maintaining the same heavy workflows and not losing any functionality.
These are ordered by most effective in reducing writes, so it's a good order to try them in.
- Using a browser with tab discarding - As of Big Sur 11.2.3 this is the most effective step to try to reduce writes. Do note that you're only going to notice major improvements if you browse with more than 5 tabs, or if you often close and open new tabs.
Currently, Safari is unfortunately often a major culprit in writing excessive data to the SSD, especially due to it's excessive website data caching. Safari will often cache any tab you close to 'Safari Web Content (Cached)', which is kept in your memory, and if any other app requires your RAM the cached website data gets written as swap to the SSD. Secondly, Safari has no tab discarding/sleeping features which means that the more tabs you open, the more memory used, which leads to excessive SSD swap writing.
Solution: Switching to one of the many alternative M1 native browsers available, and installing a tab discarding extension such as Auto Tab Discard. Many viable options exist, but in terms of memory efficiency the best options include Brave, Firefox, and Vivaldi. Alternatively you can also use Chrome, or Microsoft Edge but Edge lacks the cache disabling flags and it requires setting the Edge cache folder to Read Only. All of these browsers support Auto Tab Discard (Firefox has it in it's native extension store), with Brave, and Vivaldi both being Chromium browsers which allows them to access the large Chrome Extension Web Store.
Once you choose one of these browsers (feel free to try them all), the next step is to download and configure Auto Tab Discard. This extension releases the memory of tabs that do not need to be actively taking it, but your scroll position on the page is preserved so that when you click back on the tab it appears as if nothing happened. Once you've installed ATD to your browser, click on the extension icon and go into options, and here you can configure how you want ATD to behave.
I recommend discarding inactive tabs after 1 minute, when the number of inactive tabs reaches 2. Set maximum number of tabs to check for discarding per automatic discarding request to 500, and the number of allowed simultaneous discarding jobs to 1000. The rest of the options are up to you.
The last optimisation step to take is to turn off browser caching.
For Brave / Vivaldi: open a new tab and type chrome://flags .Once in here, search 'caching' and enable 'Turn off caching of streaming media to disk while on battery power' and 'Turn off caching of streaming media to disk', and disable 'Back-forward cache'. Restart the browser and you're done.
For Firefox: open a new tab and type about:config .Accept the warning message, and search 'cache'. Turn all the browser.cache settings to false by clicking on the 'true' value.
- Adjusting pmset settings - pmset on M1 is responsible for how the mac acts during sleep. On the M1 it is very limited compared to Intel macs, and essentially all the options that are available are safe to toggle on and off. If switching from Safari as above is not enough to fix your writes, then this is the next best step to try.
Open Terminal and type "pmset -g" - this will give you your current pmset settings.
I've set all of the following options to 0:
- powernap - SleepServices - womp - networkoversleep - ttyskeepawake - tcpkeepalive
and have noticed no difference to the function of my M1 mac or any services such as iCloud / Messages syncs etc.
To set them to 0, simply type "sudo pmset -a powernap 0", then enter your password, and press enter. Replace 'powernap' with each of the other setting names to toggle them all to 0. After you do them all, you can check the settings again using "pmset -g".
With all of these options set to 0, my mac writes significantly less data during sleep. Note that the only function that is disabled AFAIK is Remote Locking the Mac from Find My when it's sleeping and connected to Wi-Fi, so if you need this function you will be unable to disable some of these. And if you do notice any other functional difference, simply set them back to 1 with "sudo pmset -a powernap 1".
- Limit spotlight indexing - Spotlight is a great macOS feature, but chances are you do not need to search for everything that it indexes by default. Spotlight indexing writes to the SSD, so limiting this will reduce writes.
Go to System Preferences and then to Spotlight. In here, under the 'Search Results' tab look through all the available categories, and untick any categories that you never need to search for. In 'Privacy' you can directly add any folders you never need to search in. Personally, here I've added all the folders in 'Library' (in Finder click 'Go' in the menu bar, hold option and 'Library' will show up) other than Application Support. You can add most of the folders in here to Privacy because they're generally not of interest to searching, and doing so helps limit unnecessary spotlight indexing.
- Prevent Time Machine Local Snapshots - Time Machine is a great way to backup your system to an external drive, but local snapshots are likely not useful / unnecessary for most people and just a waste of SSD writes.
Go to System Preferences and then to Time Machine. Click 'Options' and press the +, and proceed to add Macintosh HD (your whole system drive) to be excluded, then click Save.
When time comes to make a backup, simply go back into these Options and remove 'Macintosh HD' from the exclusion list to proceed with backing up as normal!
- Limit unneeded startup apps / Intel apps - Rosetta 2 is an amazing technological accomplishment allowing the M1 chip to run x86 software, however running apps through Rosetta 2 is known to take up more memory than M1 native options.
To check which apps are started up with your Mac, go to System Preferences then search Login Items - this shows which apps launch when you boot your Mac. Remove any apps from this list that you do not need / do not use.
To check how many Intel apps you're running, go to Activity Monitor -> CPU, and click the 'Architecture' tab which sorts the apps by Intel apps first. Consider finding M1 Native versions of any Intel apps, or closing them when you don't need to use them.
Conclusion:
With all of these steps to try, it's very likely you can reduce your excessive writes to levels that are healthy for the lifetime of the Mac.
To check how healthy your writes are, go to Activity Monitor, then to Disk, and note down the number of 'Data Written'. Next, go to Terminal and type 'uptime', and note down the result. Days are '24 hours'. Take into account that Data Written will count external disk writes, so if you've written to an external drive since booting this value will be inaccurate.
Simply divide the number of GB written by the amount of hours your mac has been 'uptime' since last boot. If you're getting under 5GB written per hour, you will have no issues with your SSD during the lifetime of your M1 mac (e.g. if you're writing 5GB / hour, that accounts to 14 years minimum of SSD life on a 256GB SSD).
Hope this helps anyone who is experiencing high writes on M1!
The following is written by @telo123
For those of who use Facebook Messenger, Microsoft Teams, or Discord, I suggest using the Web App on any Chromium browser and save it as an app. When you add them as web apps, they will run natively. There are only few things that are missing on the Web App compared to the Desktop App, but the battery, RAM, and performance are more efficient on the Web App. Use this until these Apps are updated to run natively.
- For Chrome or any other chromium browser, follow instructions here (it is almost the same procedure on any other chromium browser): https://support.google.com/chrome_webstore/answer/3060053?hl=en
- For Edge, press the 3-dot menu, and go to App > Install this site as an App. This will open it as a new window. If you do NOT want a new window, but want a new Tab, go to More Tools > Save Page As.
- These apps will show on Launchpad. It will be saved in a folder called: "Chrome Apps" or whatever chromium browser you use.
- You also have the option to open it as a separate Window or for it to open as a Tab.
- For Chrome, go to chrome://apps to change this setting.
- You also have the option to open it as a separate Window or for it to open as a Tab.
- You can change the app icon to match with Big Sur style. You can get icons from here: https://macosicons.com/
- Go to Resources Tab from the website to learn how to replace icons.
- Disclaimer: the macosicons website was hacked recently, but it is still safe! Not all icons may be present, but the owner is working in restoring every icon that was submitted.
Attachments
-
Screenshot 2021-04-26 at 19.59.25.png1.9 MB · Views: 1,003
-
Screenshot 2021-04-14 at 18.12.51.png181 KB · Views: 342
-
Screenshot 2021-04-26 at 21.23.06.png144.5 KB · Views: 331
-
Screenshot 2021-04-26 at 21.26.40.png154 KB · Views: 341
-
Screenshot 2021-04-26 at 21.24.16.png322.4 KB · Views: 344
-
Screenshot 2021-04-26 at 21.24.49.png35.3 KB · Views: 287
-
Screenshot 2021-04-26 at 21.25.19.png193 KB · Views: 270
-
Screenshot 2021-04-26 at 21.24.26.png349 KB · Views: 336
Last edited: