LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Small Writes using Write to Text File Funtion - Wear on SSD?

When writing small amounts of data, on the order of 150 bytes, every 1/10th of a second continuously using the Write to Text File Function, how much will this wear on common SSDs? Doing some basic math this would be about 50 GB a year, not bad. But reading the article linked below begs more questions. However, the problem the article describes involves flushing the file right? Which would be done by the Flush File function or when there is a page of data ready to be written or the file is closed or perhaps a few other times right? So this should not be an issue?

 

SSD wear and frequent small writes into MySQL DB

 

Anything else I should be aware of?

0 Kudos
Message 1 of 3
(123 Views)

Technically, yes. Also, a SSD works in larger blocks internally (250kb if memory serves), which thus can hold several small files. Updating one requires it to read the block, change the memory and write back. This is however part of the built in drivers so nothing you can control (but a reason why even SSDs needs to be defragmented, which is also automatic nowadays).

To reduce wear it tends to "write back after modification" to another block.

 

(Based on old articles i've read a long time ago)

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 3
(81 Views)

"Not an issue" is a bit strong wording I think. It is of course not as bad as you might at first feel like. There is a lot between the user space file IO functions that LabVIEW itself calls and the actual PCIe bus connecting the SSD to your system. This includes the OS file caching which will usually collect modifications to files and only really write them out during less busy times or when the cache starts to get full. And then there is the controller on the SSD itself which usually has an intermediate static memory cache of 100 to 250 MB and more nowadays. Without this cache, the modern write and read speeds of like 6000 MB/s are simply not attainable. Those speeds are also a bit of a lie really, because once that cache is exhausted, the actual transfer speed drops dramatically and the >6000 MB/s that is sold as product feature drops to a much lower sustained speed of 1000 to 1500 MB/s.

 

As such it is true that frequent writing to the SSD is not as bad as it may seem. There are a lot of mitigating factors in between your file Write function and the actual SSD memory. But not as bad doesn't mean it is of no concerns at all. And the quality and brand of the SSD also makes a difference. Not every SSD has the same life expectation and write wear factor. Here, quality usually translates to price but you can have bad luck and pay for an expensive brand product and get a relabeled, no name, low quality product. And even high quality brands sometimes have bad Monday production runs.

Rolf Kalbermatter
My Blog
Message 3 of 3
(72 Views)