Community discussions

MikroTik App
 
TheMG
just joined
Topic Author
Posts: 15
Joined: Mon Mar 15, 2010 4:59 am

NAND flash memory life expectancy (write cycles)

Tue Jul 06, 2010 11:18 am

Had a quick glance at my RB450G's system resource statistics and noticed something...

write-sect-total seems to be pretty high and keeps going up a little too fast for my liking. Am I worrying too much, or is there something going on that is going to wear out the flash memory prematurely?

What can I do to minimize flash memory writes as much as possible? Logs and stats are written to RAM memory (which s default setting). Can't think of what else would be writing to the flash memory this much!
                   uptime: 16w5d5h37m48s
                  version: "4.6"
              free-memory: 240124kB
             total-memory: 257360kB
                      cpu: "MIPS 24K V7.4"
                cpu-count: 1
            cpu-frequency: 680MHz
                 cpu-load: 1
           free-hdd-space: 481052kB
          total-hdd-space: 520192kB
  write-sect-since-reboot: 2282996
         write-sect-total: 2282996
               bad-blocks: 2
        architecture-name: "mipsbe"
               board-name: "RB450G"
So, yeah, is this cause for concern or normal?
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: NAND flash memory life expectancy (write cycles)

Tue Jul 06, 2010 5:23 pm

That is a lot of writes. Are you 100% sure that the logs aren't written to a file? Do you have lots of DHCP lease changes that are written to disk too often? You can adjust the server settings to only to do every now and then. Are you running a web proxy writing to the disk?
 
changeip
Forum Guru
Forum Guru
Posts: 3829
Joined: Fri May 28, 2004 5:22 pm

Re: NAND flash memory life expectancy (write cycles)

Tue Jul 06, 2010 6:47 pm

are you using /tool graphing? Change that to 24 hours and see what happens.
 
TheMG
just joined
Topic Author
Posts: 15
Joined: Mon Mar 15, 2010 4:59 am

Re: NAND flash memory life expectancy (write cycles)

Tue Jul 06, 2010 7:21 pm

/tool graphing> print
   store-every: 5min
  page-refresh: 300
I guess that would be it.

Changed to every 24 hours.

I also changed:
/ip dhcp-server config set store-leases-disk never


Previously was set to 5min. I really have no need for that to be written to disk.

Anything else I need to watch out for? I don't have web proxy running.

Is there any way to change the location where graphing data is stored? I'm thinking of picking up a microSD card and storing as much as possible there instead of the built-in memory. Replacing an SD card is significantly easier than replacing a SMT NAND memory chip.

How much wear do you think this put on the built-in memory? Is it almost toast or still got a long way to go? I guess that depends if there's good wear-leveling mechanisms in place.
 
TheMG
just joined
Topic Author
Posts: 15
Joined: Mon Mar 15, 2010 4:59 am

Re: NAND flash memory life expectancy (write cycles)

Tue Jul 06, 2010 10:44 pm

The number of writes is now at about 25 per hour instead of the previous 812 per hour.
 
User avatar
THG
Member
Member
Posts: 472
Joined: Thu Oct 15, 2009 1:05 am

Re: NAND flash memory life expectancy (write cycles)

Wed Jul 07, 2010 3:46 pm

I also had a similar problem, my log were full of login attempts. After I fixed that, now sector writes since reboot is only around 40 000 after 304 days.
 
missinlnk
Member Candidate
Member Candidate
Posts: 113
Joined: Wed Aug 13, 2008 8:10 pm

Re: NAND flash memory life expectancy (write cycles)

Wed Jul 07, 2010 11:26 pm

I also changed:
/ip dhcp-server config set store-leases-disk never


Previously was set to 5min. I really have no need for that to be written to disk.
So if your RB450G reboots, are all of your clients directly attached to the RB450G so they will immediately pull a new IP address when their ethernet ports are turned off? If not, you'll want this written to the hard disk to prevent the DHCP server handing out duplicate IP addresses on your network after a power cycle.
 
adrianatkins
Long time Member
Long time Member
Posts: 556
Joined: Wed Sep 05, 2007 10:34 am
Location: Spain
Contact:

Re: NAND flash memory life expectancy (write cycles)

Thu Jul 08, 2010 12:46 am

One would hope that the DHCP lease time was low, like an Hour or two, and that a critical bit of kit like a DHCP server has a lot of power protection, so it very very rarely reboots.

Your point is very good.
 
missinlnk
Member Candidate
Member Candidate
Posts: 113
Joined: Wed Aug 13, 2008 8:10 pm

Re: NAND flash memory life expectancy (write cycles)

Thu Jul 08, 2010 1:01 am

One would hope that the DHCP lease time was low, like an Hour or two, and that a critical bit of kit like a DHCP server has a lot of power protection, so it very very rarely reboots.

Your point is very good.
And it does look like he has it on a UPS and power cycling isn't normally an issue. I'm just thinking that if he ever needs to upgrade the firmware, he'd have a fun half hour afterwords (in your scenario) waiting for all of the clients to pull their new IP addresses. :D

This is only an issue if the DHCP server is pulling from a pool, of course. If all of the clients are statically assigned on the DHCP server, this wouldn't be an issue.
 
TheMG
just joined
Topic Author
Posts: 15
Joined: Mon Mar 15, 2010 4:59 am

Re: NAND flash memory life expectancy (write cycles)

Thu Jul 08, 2010 11:26 am

If all of the clients are statically assigned on the DHCP server, this wouldn't be an issue.
Bingo. All my network devices/hosts/clients are statically assigned. Makes it easier to keep track of things when each devices keeps the same IP address.

Though "guest" devices are assigned from the DHCP pool.

My RB450G has on the order of about 5 hours worth of battery backup. Everything else will end up losing power long before the router does.
I also had a similar problem, my log were full of login attempts. After I fixed that, now sector writes since reboot is only around 40 000 after 304 days.
Hmmmm that's still quite a bit lower. At the current rate I'm expecting around 180,000 writes in that same time span.


Am I worrying unnecessarily?
 
daviddem
Frequent Visitor
Frequent Visitor
Posts: 62
Joined: Sun Sep 18, 2011 12:16 pm

Re: NAND flash memory life expectancy (write cycles)

Wed Dec 28, 2011 11:35 am

Again reviving an old post, sorry :D

I am running userman, hotspot, web proxy (not caching though), dhcp, dns on an all-in-one 450G "pumped up" SOHO router.

Getting about 35000 sectors written per hour :shock:

If I am not mistaken, one sector on the NAND is 16kB, so that would be about 546MB written per hour!

So I figure if the 512MB NAND is rated for 100,000 write cycles, it will last about 93,000 hours or 3907 days or 10.7 years.

Are the above calcs correct or not? Is it userman causing so many writes?

Looks like I need to try harder to get the microSD working...
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: NAND flash memory life expectancy (write cycles)

Thu Dec 29, 2011 1:59 pm

yes, userman could cause a lot of writes (logs and stuff)
 
gsloop
Member Candidate
Member Candidate
Posts: 213
Joined: Wed Jan 04, 2012 11:34 pm
Contact:

Re: NAND flash memory life expectancy (write cycles)

Fri Apr 27, 2012 8:45 pm

I've been told, in this thread [http://forum.mikrotik.com/viewtopic.php?f=2&t=60963], that a "sector" is 2KB (2048 bytes) - so 35,000 sectors would only be ~72MB.

If you look at that thread, I believe that
1) if the spec MikroTik gives is actually correct, and NAND should survive ~100,000 writes
2) Then, if you do less than around 27,000,000 [27 million] writes a month
3) You'll only consume about half the 100,000 write cycles in 20 years.

More details in the thread cited.

HTH

-Greg

Who is online

Users browsing this forum: No registered users and 21 guests