OPNsense Forum

Archive => 21.1 Legacy Series => Topic started by: eponymous on April 27, 2021, 12:28:01 pm

Title: SSD / eMMC wear out & ram disks on 21.1
Post by: eponymous on April 27, 2021, 12:28:01 pm
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.
Title: Re: SSD / eMMC wear out & ram disks on 21.1
Post by: errored out on April 30, 2021, 01:30:17 am
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.
Title: Re: SSD / eMMC wear out & ram disks on 21.1
Post by: eponymous on May 23, 2021, 03:33:19 pm
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.
Title: Re: SSD / eMMC wear out & ram disks on 21.1
Post by: 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?
Title: Re: SSD / eMMC wear out & ram disks on 21.1
Post by: errored out on August 08, 2021, 02:00:56 am
I'm guessing that would be a freebsd question.  Have you tried iostat in the console? 

Something like
iostat -x 1 5
Title: Re: SSD / eMMC wear out & ram disks on 21.1
Post by: eponymous on August 08, 2021, 06:14:49 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)