News for hackers. Stuff that matters.
Re:M1 Mac owners are experiencing high SSD writes over short... by tomxor on Wednesday February 24, 2021 @10:11AM (#26250674)
> Data Units Written: 303,071,863 [155 TB]

That's insane, I don't trust it though:

  155 TB / (75 days *24*60*60) * 2**20 = ~25 MB / s
If we are more reasonable and say it's running for 12 hours out of the day then that works out at a continuous 50MB/s of writes.

For comparison, My daily Linux laptop (XPS 13, 512GB Samsung NVMe SSD) has a total of 3.7 TB of writes over 3 years, this is my work dev and home laptop, it's in constant use (although no video editing):

  3.7 TB / (1095 days *24*60*60) * 2**20 = 0.041 MB / s
There are three orders of magnitude difference there. I can only think of three explanations: 1. the SMART reporting is wrong, 2. MacOS or M1 SSD controllers have serious write amplification issues, or 3. you are actually doing something that does need serious write throughput like lots of video editing (your stat's aren't impossible after all).
Re:M1 Mac owners are experiencing high SSD writes over short... by yarcob on Wednesday February 24, 2021 @11:14AM (#26251529)
There's an option 4: you are running out of RAM and macOS is doing a lot of swapping.

These SSDs can probably write on the order of 3000MB/s = 0.003TB/s, so you could end up with 155 TB total writes after just 155/0.003/3600 = 14 hours of RAM heavy workload.

Re:M1 Mac owners are experiencing high SSD writes over short... by tomxor on Wednesday February 24, 2021 @12:50PM (#26253071)
It would have to be a legitimately RAM heavy workload though... running out of RAM due to leaving applications open (or browser tabs open), might result in swapping out those to disk until they are used again. But the level of swapping required to generate this much write usage would essentially be using the disk as RAM, as in the running program doesn't have enough RAM, either due to needing more than physically available or due to buggy memory management.
Re:M1 Mac owners are experiencing high SSD writes over short... by yarcob on Wednesday February 24, 2021 @02:48PM (#26254711)
Right, I was thinking of things like large simulations where you need to keep a large dataset in RAM and update every datapoint at every iteration.

Or maybe multiple VMs running simultaneously doing CI jobs could also do it.

I don't think simple memory errors like leaks would cause it, since that would just end up filling the disk once, but wouldn't go through writes quite as fast.

Re:M1 Mac owners are experiencing high SSD writes over short... by cozzyd on Wednesday February 24, 2021 @04:23PM (#26256189)
The symmetry between reads and writes precludes a lot of options (like logging gone mad). I'm not even sure most SWAP ends up read back in...
Re:M1 Mac owners are experiencing high SSD writes over short... by tomxor on Wednesday February 24, 2021 @07:30PM (#26258219)
That reminds me, when SSDs first came out we'd have to set noatime on nix stuff including macs, to prevents the OS from writing file access times every time a file is read, otherwise it would cause significant write amplification. Modern SSD controllers are clever enough to make this unnecessary these days, but it could be something similar... either with the SSD controllers themselves or a file system behavior spaced just right in time to turn 1 byte into 4096 bytes of effective NAND writes - That's only 24GB of requested writes turning into 100TB in the worst case.