2

To be specific about my issue, I have a script that uses youtube-dl to download videos and outputs its progress to a file. This means youtube-dl is constantly writing to a file on disk (on /tmp), every second or so. I do this since I have another script that needs to be run independently whose sole purpose is to check the progress of the download.

However, I’m worried about my SSD being weared down by so many frequent writes (I have many other scripts that use similar techniques) and was thinking there might be other solutions. Today I thought about writing the progress to RAM, and was glad to find this is really easy to do on OS X.

On further inspection, though, I also see many people claiming RAM disks are a thing of the past and not really needed these days, since modern systems like OS X automatically implement other solutions that make them not needed.

Opinions are pretty divided. Since making and mounting a temporary RAM disk is so incredibly easy, if it realistically decreases the amount of writes to the SSD and has no repercussions on the RAM, I don’t see why not use it. Is there anything I’m missing?

2
  • Read/Writes it won't affect your SSD health. The most thing that affects SSD is the Power Cycle. The more its on, the shorter it'll live.
    – iSR5
    May 2, 2016 at 5:20
  • I've been using a RAMDisk cache for one app for about 6 years or so. It certainly makes the whole thing zippier & as there is no read/write to your HD/SSD at that time, then it can only 'save wear' for any given value of 'wear'. The trick is to copy it out from HD at launch, with an option to write back at quit. Then, so long as you have no power-outage, your RAMDisk is reasonably loss-proof.
    – Tetsujin
    May 2, 2016 at 10:06

2 Answers 2

1

On Linux, tmpfs is most definitely not a thing of the past. Depending on whether your workload is (disk-)IO-bound, it could speed things up a lot. Using it is very easy, too:

mount -t tmpfs none /path/to/target

It gets better: tmpfs will only claim memory when files are put on it. An empty tmpfs instance requires almost no memory.

However, I haven’t tried the OS X ram:// storage yet. From how it looks, it is not lazy-allocated.

Again depending on your workload (create and delete?), the temporary files you create may not even be flushed to disk, because that is only done at intervals.

So yes, memory storage can help reduce fixed storage wear, whatever type it may be. It can even speed some workloads up.

SSD wear is usually not an issue these days. However, you need to consider write amplification when creating small files.

0

I wouldn't worry about it too much... SSD's are tough. But I would make sure your valuable files that you cannot loose are on like a separate hard drive or NAS. Just in case there is a data failure. Magnetic Drives are even tougher, but slower. Another thing that might affect the wear of your SSD is temperature. I would be more worried about temperature than constant temporary file writing on the SSD.

3
  • Interesting item: Google did some research on this which showed that SSDs last, on average, 4 years in a data center, an environment that can be considered particularly hostile to storage devices.
    – Ouroborus
    May 2, 2016 at 5:03
  • @Ouroborus very interesting indeed
    – Noah
    May 2, 2016 at 5:09
  • @Ouroborus, The kind of writes that google databases do is diffferent from the kind of writes that file databases do.
    – Pacerier
    Jan 4, 2018 at 4:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .