Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

v10 TeslaCam- supposed to overwrite, do I even need > 16GB USB now?

This site may earn commission on affiliate links.
TRIM does not work when formatted with Fat32 and tesla computer anyways, so you won't get good wear leveling with an SSD in a tesla vs a PC anyways. That said I still went with T5 SSD. They are not expensive enough to worry about.

TRIM doesn't matter on an SSD/flash drive used the way they're used for Dashcam/Sentry modes. TRIM just pre-clears blocks of data that are marked as erased, which is only helpful if you have a drive that isn't completely full all the time and is used in a non-consistent manner. Since a drive used for dashcams should be close to 100% full all the time, there's literally no point to TRIM. This also means that theoretically, you should have relatively even wear on the entire SSD, since you'll be circularly writing to every single block on the drive. It's not quite that simple since SSD controllers do some weird magic behind the scenes... but it's probably pretty close to that.
 
  • Disagree
Reactions: Jedi2155

This is a very old article from 2010... they reference testing 64MB, 2GB, and 512MB drives. Most drives were much larger silicon nodes (not 15nm or whatever it is these days), and not even all of them used MLC (2-bit-per-cell) memory. Things have gotten much worse more recently, although much of this is masked by very complicated wear leveling strategies.
 
2019 Solid State Drive (SSD) Buying Guide - Smart Buyer

Just to actually cite a real, recent, source with real numbers on write cycles for types of flash...


Realistically cheaper flash storage is gonna be TLC or QLC...(including both random USB keys and the cheaper SSDs like the T5) so 3000 or 1000 write cycles respectively.

On a 16GB drive you will burn through that pretty quick.

On a 128-256GB one you'll likely not burn through that in less than the average number of years people own a car.

With 4 cameras you're writing 120 megs a minute... or ~7.2 gigs an hour.

Let's say you run it for 9 hours a day (8 hours at work and 1 hour of driving- it's probably less on weekends but maybe a little more drive for some, so this seems a decent average.).

That's 64.8 gigs a day... So a 16GB key burns through 4.05 cycles per day. A 128 uses ~0.51, a 256 uses 0.25 cycles.

At 1000 cycles that means the 16GB key is done in 246.91 days... just over 8.2 months.

The 128GB key is good for 1960.78 days, just under 5 years...or 5.37 years.

The 256GB key is good for 2x that of course, or nearly 11 years.

Even if you get the higher end of the low end (TLC) you're only at 3x these numbers, so the 16GB key is still done in about 2 years... while the 128 and 256 can chug along for ~15-30 years.

All the above will get a bit shorter if you save any video long-term, making the 16GB even worse in comparison really. But should give you a decent idea.
 
Your numbers make it sound like an old, less than TLC flash is the ticket

There's a tradeoff there. Old enough, and you start getting MLC memory that doesn't have great write endurance either. For comparison, the Samsung 860 EVO vs. 850 EVO are both MLC (2-bit-per-cell). The 860 EVO, though, has double the write endurance of the 850 EVO.

The Samsung T5 doesn't even come with a TBW specification... so hard to say how good it is. In general though, any decent quality 256GB+ SSD is probably going to be perfectly fine in this application for quite some time. It's just too much data to write and the Tesla's don't pump out THAT much data.
 
Let's say you run it for 9 hours a day (8 hours at work and 1 hour of driving- it's probably less on weekends but maybe a little more drive for some, so this seems a decent average.).

That's 64.8 gigs a day... So a 16GB key burns through 4.05 cycles per day. A 128 uses ~0.51, a 256 uses 0.25 cycles.

At 1000 cycles that means the 16GB key is done in 246.91 days... just over 8.2 months.
It's not going to be writing 9 hours a day. I don't know a single person that drives nine hours a day, everyday. Also, as far as I know Sentry mode only writes when it detects something, so it won't be writing 99% of the time the car is parked. 1 - 2 hours per day is probably is much better estimate with you're using the drive cam function. So, your 8.2 months just turned into 4 years. In my case, I only drive about 45 mins. per day and less than that on the weekends. So, my 32 gig USB stick is going to last about last about 10+ years by your numbers.

I've worked in the computer field for 30 years with with all of them involving desktop and hardware support. The last five years or so, we had SSDs in the desktops and laptops instead of HDs. That whole time I never had USB stick or an SSD go bad with the exception of one USB stick that got washed and dried TWICE (failed the second time) and one SSD that was DOA in a new laptop. We had far more spinning HDs go bad.

Here is a more recent article: SSD Lifespan: How Long Will Your SSD Work?

Flash drives: For how long can USB Memory Sticks really retain your data? - iPromo
 
TRIM doesn't matter on an SSD/flash drive used the way they're used for Dashcam/Sentry modes. TRIM just pre-clears blocks of data that are marked as erased, which is only helpful if you have a drive that isn't completely full all the time and is used in a non-consistent manner. Since a drive used for dashcams should be close to 100% full all the time, there's literally no point to TRIM. This also means that theoretically, you should have relatively even wear on the entire SSD, since you'll be circularly writing to every single block on the drive. It's not quite that simple since SSD controllers do some weird magic behind the scenes... but it's probably pretty close to that.

You have a problem to your logic there especially with the comment that a drive should be close to 100% full. This is VERY bad for a flash drive. If you have a close to full flash drive, your drive fail MUCH sooner. Say you had a 256 GB drive that's 90% full (238 GiBi bytes actually) so 23.8 GB according to windows.

Since you aren't clearing the old data, the flash drive cannot use the 90% of full space for wear leveling purposes so you only have 23.8 GB to work with.

Sentry mode is writing CONTINUOUSLY, not only when the event occurs. How else does it capture video before the event? An event is typically at the 9 minute mark.

So let's do the calculations again assuming 1000 P/E write cycles, 90% full, 256 GB flash drive with v10 software.
1 minute = 113 MB of writes. This assumes HW2.5 H264 (I don't know H265 sizes).

Let's say you park your car with sentry mode active 12 hours a day (8 AM to 8 PM), or you park somewhere where you leave your car parked.

Sentry mode will write approximately:
12 hrs * 60 min * 113 MB/min = 81 GB of writes per 12 hr period.
1000 P/E cycles on 23.8 GB = 1000*23.8 = 23.8 TB
23,800 / 81.3 = 292 days of life or about 10 months.

You'd think your nice large flash drive will save you but it will die in less than a year if you don't empty it.

Let's do the same calculation where you empty it about once a month (i generate about 60 GB of sentry video's a month). so 25% used capacity.
238 GB * (1.00 - 0.25) = 178.5 GB of usable space for wear leveling.
178,500 / 81.3 = 2195 days of wear leveling available or about 6 years.

Assuming you have sentry running 24/7 because you park outdoors will basically halve the above lives.

If you had a 8 GB drive - you only have enough space for ONE save event (6.7 GB for the 1 hr circular buffer + 1.1 GB for 1 save event). Your available space for wear leveling is likely only 1 GB or less.
If you had a 16 GB drive you'd only have space for 7-8 save events.
 
It's not going to be writing 9 hours a day. I don't know a single person that drives nine hours a day, everyday. Also, as far as I know Sentry mode only writes when it detects something

This is not correct- as explained by a couple of previous posters.

, so it won't be writing 99% of the time the car is parked.

That's true- it'll be 100% of the time, assuming Sentry is on.

So, my 32 gig USB stick is going to last about last about 10+ years by your numbers.

Nope. Because, again, it's writing 100% of the time Sentry is on. It has to be in order to be able to save off the previous 10 minutes when it goes into alert mode.

So it'll last less than a year if it's QLC, maybe 2-3 years if it's the next grade up.
 
You have a problem to your logic there especially with the comment that a drive should be close to 100% full. This is VERY bad for a flash drive. If you have a close to full flash drive, your drive fail MUCH sooner. Say you had a 256 GB drive that's 90% full (238 GiBi bytes actually) so 23.8 GB according to windows.

Since you aren't clearing the old data, the flash drive cannot use the 90% of full space for wear leveling purposes so you only have 23.8 GB to work with.

Sentry mode is writing CONTINUOUSLY, not only when the event occurs. How else does it capture video before the event? An event is typically at the 9 minute mark.

So let's do the calculations again assuming 1000 P/E write cycles, 90% full, 256 GB flash drive with v10 software.
1 minute = 113 MB of writes. This assumes HW2.5 H264 (I don't know H265 sizes).

Let's say you park your car with sentry mode active 12 hours a day (8 AM to 8 PM), or you park somewhere where you leave your car parked.

Sentry mode will write approximately:
12 hrs * 60 min * 113 MB/min = 81 GB of writes per 12 hr period.
1000 P/E cycles on 23.8 GB = 1000*23.8 = 23.8 TB
23,800 / 81.3 = 292 days of life or about 10 months.

You'd think your nice large flash drive will save you but it will die in less than a year if you don't empty it.

Let's do the same calculation where you empty it about once a month (i generate about 60 GB of sentry video's a month). so 25% used capacity.
238 GB * (1.00 - 0.25) = 178.5 GB of usable space for wear leveling.
178,500 / 81.3 = 2195 days of wear leveling available or about 6 years.

Assuming you have sentry running 24/7 because you park outdoors will basically halve the above lives.

If you had a 8 GB drive - you only have enough space for ONE save event (6.7 GB for the 1 hr circular buffer + 1.1 GB for 1 save event). Your available space for wear leveling is likely only 1 GB or less.
If you had a 16 GB drive you'd only have space for 7-8 save events.

Who here actually bothers emptying out the flash drive to try to keep it 90% full? I don't. And again, it does not matter if you're using it for dashcam/sentry, because the dashcam deletes the oldest videos for you automatically. With the latest update, it does the same for sentry mode videos. Once the oldest video is deleted, you now write over that space and congratulations... you have even wear on the flash drive. What's the concern here? That the circular buffer for sentry it's using will just write over the same space over and over? Assuming you use it consistently, then the dashcam should overwrite previous space used for the circular buffer, and the next time you activate sentry, you'll write to a different set of blocks for the next sentry activation.
 
Personally, I use a 512GB SSD connected to a USB -> SATA adapter. It's way overkill, but I don't ever have to worry about crappy flash drives dying on me and I had a spare lying around. A 512GB SSD these days is dirt cheap and a dongle to convert to USB is like $10. For $100 you can be set for the duration of your car. But hey, why bother spending $100 on a car that costs >$30k? :)

I do the same thing as I had an old Samsung enterprise SSD left over from an old PC. The issue with those of us in cold weather climates is that drive is only spec'd to 0C. I'd imagine it will work in colder temperatures, but this will be my first winter where I get to test my theory!
 
I do the same thing as I had an old Samsung enterprise SSD left over from an old PC. The issue with those of us in cold weather climates is that drive is only spec'd to 0C. I'd imagine it will work in colder temperatures, but this will be my first winter where I get to test my theory!

Not a problem for me luckily. Not often it gets below freezing here. Even still, given you have this in the center console, I would be surprised if it didn't stay quite a bit warmer than the rest of the car. Plus, if you're a heavy sentry user, the SSD by itself should generate ~1-2W of heat... which I bet is enough to self-warm the console and be fine.

My guess is they don't want to bother with below freezing since you start to get condensation problems with stuff icing over, so there's a liability...
 
What's the concern here? That the circular buffer for sentry it's using will just write over the same space over and over? Assuming you use it consistently, then the dashcam should overwrite previous space used for the circular buffer, and the next time you activate sentry, you'll write to a different set of blocks for the next sentry activation.

Its the exactly my concern and the cause of failure on the on the MCUv1 EEPROMs. I was just commenting on how its bad advice to keep your drive full versus emptying it periodically. Just doing it a few times a year (if you have a 500 GB drive) is loads better than just leaving it full and relying on the circular buffer. If you leave your drive full, and rely entirely on the circular buffer you'll only be able to write the same blocks over and over as the other blocks are unusable as they can't be erased since they're already storing data.

Not a problem for me luckily. Not often it gets below freezing here. Even still, given you have this in the center console, I would be surprised if it didn't stay quite a bit warmer than the rest of the car. Plus, if you're a heavy sentry user, the SSD by itself should generate ~1-2W of heat... which I bet is enough to self-warm the console and be fine.

My guess is they don't want to bother with below freezing since you start to get condensation problems with stuff icing over, so there's a liability...

I would not be too afraid of temperature related impacts of sentry to the life of the SSD wear & tear. The temperature impacts the reliability of the data through increased electron leakage or reliability of write speeds/read speeds due to thermodynamic changes at the semiconductor level. This results in increased CRC error rates due to bit level errors as the potential on the floating gate changes over time. This was well documented in the first uses of TLC NAND as the electron drift was significant in as little as a few months and why samsung had to release new firmware to periodically "refresh" the data.

FYI the Samsung 840/850 series were TLC tech, and some of the latest 860 QVO are QLC which is 1 level worse than what you see below:
Screen%20Shot%202014-10-16%20at%2018.54.46_575px.png

To give you an idea of the level of accuracy required, cell voltage is typically 0-5V. Meaning with TLC technology (most commonly used today, with limited sprinkling of QLC) you might have threshold voltages of only 0.3 or 0.2v deltas between bits where voltage drift can be significant.



TLC%20asd_575px.PNG


Temperature can impact this drift significantly but it has nothing to do with the P/E write limitations which is related more to the general operation of flash memory.

BTW, for general knowledge NAND chips wear out over time because they store data via hot carrier injection (think of it as shooting a gun through a wall) in order to store data thus the term "flash" memory. Over time shooting it repeatedly wears out the insulation (dielectric resistance) to the point where the bit loses all its ability to store a charge due to electromigration.
 
Its the exactly my concern and the cause of failure on the on the MCUv1 EEPROMs. I was just commenting on how its bad advice to keep your drive full versus emptying it periodically. Just doing it a few times a year (if you have a 500 GB drive) is loads better than just leaving it full and relying on the circular buffer. If you leave your drive full, and rely entirely on the circular buffer you'll only be able to write the same blocks over and over as the other blocks are unusable as they can't be erased since they're already storing data.

Again, sure, it's better probably to allow the wear leveling algorithms to do there thing, but ultimately I do not think it will make any difference what-so-ever in longevity. If you have dashcam footage running as well (which you can't even turn off, so you do), then the pointer to whereever this circular buffer starts will move every single time you go for a drive. Unless you have evidence to the contrary, I don't think Tesla pre-allocates a certain amount of space on the drive and then doesn't let you use it for 'sentry mode' only. I just writes out the last available space. So, again, it puts stress on a specific group of cells for the one time you run sentry mode, but then it will use an entirely different group of cells the next time you activate sentry mode. No advanced wear, because over time it should evenly wear every cell, since they'll all get turns to be used as the circular buffer.

This breaks down, of course, if you don't have a large enough drive and you are always using some portion of the drive as the buffer... but obviously this wouldn't be the case in any drive that's 128GB+.

I would not be too afraid of temperature related impacts of sentry to the life of the SSD wear & tear. The temperature impacts the reliability of the data through increased electron leakage or reliability of write speeds/read speeds due to thermodynamic changes at the semiconductor level. This results in increased CRC error rates due to bit level errors as the potential on the floating gate changes over time. This was well documented in the first uses of TLC NAND as the electron drift was significant in as little as a few months and why samsung had to release new firmware to periodically "refresh" the data.

FYI the Samsung 840/850 series were TLC tech, and some of the latest 860 QVO are QLC which is 1 level worse than what you see below:
*snip*
To give you an idea of the level of accuracy required, cell voltage is typically 0-5V. Meaning with TLC technology (most commonly used today, with limited sprinkling of QLC) you might have threshold voltages of only 0.3 or 0.2v deltas between bits where voltage drift can be significant.
*snip*

Temperature can impact this drift significantly but it has nothing to do with the P/E write limitations which is related more to the general operation of flash memory.

BTW, for general knowledge NAND chips wear out over time because they store data via hot carrier injection (think of it as shooting a gun through a wall) in order to store data thus the term "flash" memory. Over time shooting it repeatedly wears out the insulation (dielectric resistance) to the point where the bit loses all its ability to store a charge due to electromigration.

I never said it was an issue (as you can tell from the post), although arguably Samsung (or whoever) may not have actually calculated/measured temperature/aging drift if you're operating it outside the recommended operating conditions.

Either way, hotter temperatures cause storage issues longer term. Not sure how much that matters given hopefully these things are used consistently... but there's potential that it could be off for weeks at a time and might loss data towards end of life.

Also, somewhat tangential: you're off by almost an order of magnitude on the cell voltage of modern NAND. Samsung's latest stuff has a operating voltage of 1.2 V. See their press release: Samsung Electronics Brings Next Wave of High-Performance Storage with Mass Production of Fifth-generation V-NAND
 
Again, sure, it's better probably to allow the wear leveling algorithms to do there thing, but ultimately I do not think it will make any difference what-so-ever in longevity. If you have dashcam footage running as well (which you can't even turn off, so you do), then the pointer to whereever this circular buffer starts will move every single time you go for a drive. Unless you have evidence to the contrary, I don't think Tesla pre-allocates a certain amount of space on the drive and then doesn't let you use it for 'sentry mode' only. I just writes out the last available space. So, again, it puts stress on a specific group of cells for the one time you run sentry mode, but then it will use an entirely different group of cells the next time you activate sentry mode. No advanced wear, because over time it should evenly wear every cell, since they'll all get turns to be used as the circular buffer.

The reason I started chatting about this was due to this comment
Since a drive used for dashcams should be close to 100% full all the time, there's literally no point to TRIM.

If the drive is close to full, there is literally no other room for the wear leveling algorithms to point to except the circular buffer. You need spare area area to minimize write amplification. There is tons of research on this specific topic.

mixeddataplacement.jpg

Write Amplification vs. Spare Area, courtesy of IBM Zurich Research Laboratory


There use to be an option on the topic for Samsung SSD's to specifically keep extra areas clear from usage so that you would allow the wear leveling algorithms to minimize write amplification.
0kIGP.png



This is all moot of course, as long as you periodically empty out your drive which is really my only point. Relying ONLY on Tesla's overwriting algorithms may not be sufficient.

In regards to the voltage, that's interesting that they've managed to make the chip voltage so low which further exemplifies the issue of voltage drift because the lower the voltage the less voltage it takes to cause errors to pop up.
 
The reason I started chatting about this was due to this comment


If the drive is close to full, there is literally no other room for the wear leveling algorithms to point to except the circular buffer. You need spare area area to minimize write amplification. There is tons of research on this specific topic.

*snip*
Write Amplification vs. Spare Area, courtesy of IBM Zurich Research Laboratory


There use to be an option on the topic for Samsung SSD's to specifically keep extra areas clear from usage so that you would allow the wear leveling algorithms to minimize write amplification.
*snip*


This is all moot of course, as long as you periodically empty out your drive which is really my only point. Relying ONLY on Tesla's overwriting algorithms may not be sufficient.

In regards to the voltage, that's interesting that they've managed to make the chip voltage so low which further exemplifies the issue of voltage drift because the lower the voltage the less voltage it takes to cause errors to pop up.

Write amplification isn't really a big issue when you're talking about purely sequential writing like a dashcam or sentry mode... it's not performing a bunch of random small writes, it's writing off a consistent ~4MB/s constantly. Sure, there's boundaries of the cells you have to worry about overlapping (and I'm sure they do), but I highly doubt the WA factor in this application is any higher than 1.5.

There's a site that did SSD endurance testing that essentially mimics what we're doing with the dashcam usage (albeit, much faster speeds) and they didn't have any issues writing well beyond most rated specs of these drives. If they actually had significant WA, they'd die sooner I'd think:
Introducing the SSD Endurance Experiment - The Tech Report
 
Write amplification isn't really a big issue when you're talking about purely sequential writing like a dashcam or sentry mode... it's not performing a bunch of random small writes, it's writing off a consistent ~4MB/s constantly.

Each camera writes roughly 30MB for a 1 minute file, so 4 cameras total writing 120MB/minute= 2MB/s, not 4.
 
Tangential, but sentry mode would be a lot easier to use if the video was marked when events occurred.

I actually submitted this exact idea to Tesla 3 weeks ago. I recently got their template answer (thanks for the idea; we can't guarantee we implement it, but appreciate the feedback).

See u/TheAcanthopterygian's post here; the short version is "The interesting stuff happens approximately N seconds into the one-but-last video, where N is the duration of the last video."
 
  • Informative
Reactions: nvx1977
See u/TheAcanthopterygian's post here; the short version is "The interesting stuff happens approximately N seconds into the one-but-last video, where N is the duration of the last video."

neat! but I don't think that's universally true. Sometimes the trigger event is in the last grouping. Sometimes it's in the third-to-last grouping.

The feature request I submitted is to flag the actual camera file with the trigger. That automatically identifies the group.