On Sun, Jun 2, 2024 at 9:27 AM Dale <rdalek1...@gmail.com> wrote: > > I thought of something on the m.2 thing. I plan to put my OS on it. I > usually use tmpfs and compile in memory anyway but do have some set to > use spinning rust. Once I get 128GB installed, I should be able to do > that with all packages anyway but still, I had a question. Should I put > the portage work directory on a spinning rust drive to save wear and > tear on the SSD or have they got to the point now that doesn't matter > anymore? I know all the SSD devices have improved a lot since the first > ones came out.
So, as with most things the answer is it depends. The drive you're using is a consumer drive, rated for 600TB in writes. Now, small random writes will probably wear it out faster, and large sequential ones will probably wear it out slower, but that's basically what you're working with. That's about 0.3DWPD, which isn't a great endurance level. Often these drives can be over-provisioned to significantly increase their life - if you're using discard/trim properly and keep maybe 1/3rd of the drive empty you'll get a lot more life out of it. In fact, the difference between different models of drives with different write endurances are often nothing more than the drive having more internal storage than advertised and doing the same thing behind the scenes. Obviously temp file use is going to eat into your endurance, but it will GREATLY improve your build performance as well, so you should probably do the math on just how much writing we're talking about. If a package has 20GB in temp files, you have to build it 30k times to wear out your disk by the official numbers. Of course, proper use of discard/trim requires setting your config files correctly, and it might reduce performance on consumer drives. When you buy enterprise NVMe you're paying for a couple of things that are relevant to you: 1. A higher endurance rating. 2. Firmware that doesn't do dumb things when you trim/discard properly 3. Power loss protection (you didn't bring this topic up, but flash storage is not kind to power loss and often performance is sacrificed to make writes safer with internal journals). 4. Sustained write performance. If you do sustained writes to a consumer drive you'll see the write speed fall off a cliff after a time, and this won't happen on an enterprise drive - the cache/etc is optimized for sustained write loads. Of course enterprise flash is pretty expensive unless you buy it used, and obviously if you do that try to get something whose health is known at time of purchase. -- Rich