Can ttraff data be saved to somewhere other than nvram?

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Goto page 1, 2  Next
Author Message
fizikz
DD-WRT User


Joined: 10 Nov 2016
Posts: 265

PostPosted: Mon Jan 10, 2022 3:40    Post subject: Can ttraff data be saved to somewhere other than nvram? Reply with quote
Can ttraff data be saved to USB storage or even the internal jffs, instead of nvram?

I just realized it's just a matter of time until nvram is filled, since ttraff stores an additional ~300 bytes per month, and that might, or will, cause issues eventually.
Sponsor
MesMurized
DD-WRT User


Joined: 08 Aug 2017
Posts: 84

PostPosted: Mon Jan 10, 2022 4:03    Post subject: Reply with quote
Sure. nvram show | grep ttraff. You'll notice which one[s] to save. Not sure what you'll do with it except reload unless you roll your own. Current releases have backup/restore
_________________
Current: Netgear R9000 DD-WRT v3.0-r55460 std (03/25/24)
Retired: Linksys WRT32X r39296, TP-Link Archer C7 v2, LinkSys WRT54G v5
fizikz
DD-WRT User


Joined: 10 Nov 2016
Posts: 265

PostPosted: Mon Jan 10, 2022 4:13    Post subject: Reply with quote
I mean can the ttraff daemon store the data directly onto a different storage instead of nvram?
MesMurized
DD-WRT User


Joined: 08 Aug 2017
Posts: 84

PostPosted: Mon Jan 10, 2022 6:45    Post subject: Reply with quote
fizikz wrote:
I mean can the ttraff daemon store the data directly onto a different storage instead of nvram?
if you're thinking of live data, then no. Maybe it's worth a request?!?? We were lucky to get save/restore current for upgrades w/reset.
_________________
Current: Netgear R9000 DD-WRT v3.0-r55460 std (03/25/24)
Retired: Linksys WRT32X r39296, TP-Link Archer C7 v2, LinkSys WRT54G v5
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14221
Location: Texas, USA

PostPosted: Mon Jan 10, 2022 12:51    Post subject: Reply with quote
It was requested already, hasn't happened yet:

https://svn.dd-wrt.com/ticket/5509

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
fizikz
DD-WRT User


Joined: 10 Nov 2016
Posts: 265

PostPosted: Mon Jan 10, 2022 17:17    Post subject: Reply with quote
kernel-panic69 wrote:
It was requested already, hasn't happened yet:

https://svn.dd-wrt.com/ticket/5509


Opened 5 years ago... Wow.

Any idea how many write or erase cycles the tiny nvram can take? At least I can monitor the free space and delete some ttraff entries myself when needed but if nvram dies then the whole router is done for.
blkt
DD-WRT Guru


Joined: 20 Jan 2019
Posts: 5700

PostPosted: Mon Jan 10, 2022 18:54    Post subject: Reply with quote
You know ttraff daemon can be disabled? Delete status WAN traffic data, services tab, disable, save, reboot.
fizikz
DD-WRT User


Joined: 10 Nov 2016
Posts: 265

PostPosted: Mon Jan 10, 2022 19:15    Post subject: Reply with quote
blkt wrote:
You know ttraff daemon can be disabled? Delete status WAN traffic data, services tab, disable, save, reboot.

Yes, but this is useful data. I don't want to have to disable or delete it.
protocol113
DD-WRT Novice


Joined: 11 Jan 2022
Posts: 1

PostPosted: Tue Jan 11, 2022 22:09    Post subject: Reply with quote
that does sound like an issue
MesMurized
DD-WRT User


Joined: 08 Aug 2017
Posts: 84

PostPosted: Tue Jan 11, 2022 22:43    Post subject: Reply with quote
Could be ... but router flash will likely give out first. Same if storing to USB flash.
_________________
Current: Netgear R9000 DD-WRT v3.0-r55460 std (03/25/24)
Retired: Linksys WRT32X r39296, TP-Link Archer C7 v2, LinkSys WRT54G v5
feliciano
DD-WRT Guru


Joined: 24 Oct 2008
Posts: 1079
Location: Latin America

PostPosted: Fri Jan 14, 2022 13:16    Post subject: Reply with quote
fizikz wrote:
Any idea how many write or erase cycles the tiny nvram can take? At least I can monitor the free space and delete some ttraff entries myself when needed but if nvram dies then the whole router is done for.

The NVRAM supports thousands of writing cycles, deppending on which technology is manufactured of. (And traff defaults nvram commmits daily).

What is more important is the limted size of the NVRAM, therefore traff uses a mechanism to automatically purge old data when the free space is low.

On the other hand, as a workaround for saving the long-term data before erasing it, we can create an script and use nvram show |grep traff and logger or ftp that to an external server, or redirect it to a local file.

_________________
If you want support, please read first the announcements and forum rules.
Si usted desea ayuda, por favor lea primero los anuncios y las reglas del foro.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12887
Location: Netherlands

PostPosted: Fri Jan 14, 2022 16:01    Post subject: Reply with quote
https://elatov.github.io/2017/01/email-dd-wrt-monthly-bandwidth-usage/
_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
fizikz
DD-WRT User


Joined: 10 Nov 2016
Posts: 265

PostPosted: Mon Jan 17, 2022 7:02    Post subject: Reply with quote
feliciano wrote:

The NVRAM supports thousands of writing cycles, deppending on which technology is manufactured of. (And traff defaults nvram commmits daily).

Thousands of write cycles sounds quite little in the context of daily writes. I hope it's more. Any idea what kind of flash that little 64KiB is?
feliciano wrote:
What is more important is the limted size of the NVRAM, therefore traff uses a mechanism to automatically purge old data when the free space is low.

Oh, I did not know ttraff can purge data. At least it avoids creating problems with no free space.

egc wrote:
https://elatov.github.io/2017/01/email-dd-wrt-monthly-bandwidth-usage/

Interesting, but not what I had in mind.

Being able to write to USB would be ideal, as requested in that ticket, because USB drives are cheap and easy to replace, compared to replacing a router. Plus with the large size of USB flash drives, it would take a long time to reach failure.
feliciano
DD-WRT Guru


Joined: 24 Oct 2008
Posts: 1079
Location: Latin America

PostPosted: Tue Jan 18, 2022 23:53    Post subject: Reply with quote
fizikz wrote:
feliciano wrote:

The NVRAM supports thousands of writing cycles, deppending on which technology is manufactured of. (And traff defaults nvram commmits daily).

Thousands of write cycles sounds quite little in the context of daily writes. I hope it's more. Any idea what kind of flash that little 64KiB is?

AFAIK, nvram is a dedicated partition of the flash of a router, therefore it has the same endurance of the technology it was choosen for the particular equipment, so it can reach 10000 or 100000 cycles deppending on that. The main constrain here is "wear leveling" technology (popular for SSDs) is complicated for an area with constant low free space.

fizikz wrote:
Being able to write to USB would be ideal, as requested in that ticket, because USB drives are cheap and easy to replace, compared to replacing a router. Plus with the large size of USB flash drives, it would take a long time to reach failure.

feliciano wrote:
a workaround for saving the long-term data before erasing it, we can create an script and use nvram show |grep traff and logger or ftp that to an external server, or redirect it to a local file.

This "local file" can be on a mounted USB drive.

_________________
If you want support, please read first the announcements and forum rules.
Si usted desea ayuda, por favor lea primero los anuncios y las reglas del foro.


Last edited by feliciano on Wed Jan 19, 2022 0:02; edited 2 times in total
fizikz
DD-WRT User


Joined: 10 Nov 2016
Posts: 265

PostPosted: Tue Jan 18, 2022 23:58    Post subject: Reply with quote
feliciano wrote:
AFAIK, nvram is a dedicated partition of the flash of the router, therefore it has the same endurance of the technology upon it was choosen for a particular system, so it can reach 10000 or 100000 cycles deppending on that. The main constrain here is "wear leveling" technology (popular for SSDs) is complicated for an area with constant low free space.


10000 or 100000 cycles would be more comfortable, but yes the wear leveling and write amplification complications remain on a tiny storage.

Any reports of dying flash on routers, a general idea of how long it typically took, and under what types of usage?
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum