SSD / eMMC wear out & ram disks on 21.1

Started by eponymous, April 27, 2021, 12:28:01 PM

Previous topic - Next topic
April 27, 2021, 12:28:01 PM Last Edit: April 28, 2021, 02:33:18 PM by eponymous
Hi,

I've been reading up as much as I can about how people run OPNsense.

I'm currently running it off an eMMC device and am using Suricata. I'm trying to reduce wear on the eMMC as much as possible so I'm also logging everything to an external syslog server - plus this is convenient.

I was just wondering if there are any benefits or indeed issues if I were to use RAMDisks for /tmp and /var?

I was having a look at: https://forum.opnsense.org/index.php?topic=1233.0 and Franco mentioned issues with service start ups if /var is in RAM - but this was back in 2015. Has this advice changed at all in 21.1? Given I'll be using Suricata I suspect this will cause problems.

Other than logging, is there anything else that might wear out the eMMC quickly or is most of OPNsense loaded into RAM anyway?

Thanks for any feedback.

If I remember correctly, you are correct.  Most of the storage I/O is from logging and there is also some RRD writes that will be omitted when running RAMdisk. 

I have not tried suricata with ramdisk.  My speculation is that there will not be issues as the rules are running from RAM as it is now through hyperscan where you can change the impact (load) by electing a lower grouping (refer to suricata documentation as I don't remember the "levels"  meaning). 

You also can lookup additional information in the manual https://docs.opnsense.org > install and setup > initial install & config.

Thanks for the info!

I've now installed a proper mSATA SSD (way larger than needed) in the unit now so I'm less worried about wear-out than I was when considering the eMMC.

Sorry to spam your thread:

how can I measure the write amount of the SSD? I have setup MONIT, and it shows read and write statistics. But my /var and /tmp is on ramdrive, and I am not sure if the root FS stats exclude the /var and /tmp amount from that?

August 08, 2021, 02:00:56 AM #4 Last Edit: August 10, 2021, 03:20:10 AM by errored out
I'm guessing that would be a freebsd question.  Have you tried iostat in the console? 

Something like
iostat -x 1 5

August 08, 2021, 06:14:49 PM #5 Last Edit: August 08, 2021, 06:16:48 PM by eponymous
Quote from: Ricardo on May 24, 2021, 02:46:22 PM
Sorry to spam your thread:

how can I measure the write amount of the SSD? I have setup MONIT, and it shows read and write statistics. But my /var and /tmp is on ramdrive, and I am not sure if the root FS stats exclude the /var and /tmp amount from that?

If it's just the SSD you're wanting to measure - just use SMART.

If you monitor the "Total LBAs written" parameter you can calculate the amount of data written.

If you're more concerned about the lifetime of the SSD, use "Percentage lifetime remaining". Look at the RAW value, it will count down from 100 (highest life expectancy) to 0 (time to look for a new drive)