OPNsense Forum

English Forums => General Discussion => Topic started by: Groveld on August 07, 2015, 08:41:40 pm

Title: The Use of RAM Disks
Post by: Groveld on August 07, 2015, 08:41:40 pm
What is the best practice regarding the use of RAM disks?
I am using OPNsense on a APU1D4 with  4GB of DRAM and an 64GB mSATA drive, currently having RAM disk disabled.
I am planning to use about 40GB of my mSATA drive for caching Windows Updates and maybe some other stuff.
Now i know that an SSD or any other kind of chip-based storage has a lower R/W cycles than normal HDD's, but is there a big difference in wear and tear over CF-cards or SSD drives for these applications or is a RAM disk a good option over-all, including HDD's?

Many thanks in advance!
Title: Re: The Use of RAM Disks
Post by: franco on August 11, 2015, 11:10:41 am
/tmp and /var MFS are a working solutions with appropriate amounts of RAM (like you have with APU) and tmpfs which has no upper bound (not in the initial 15.7, but available through an update to a current 15.7.x release).

However, /var MFS is fragile and introduces problems with service startups all through FreeBSD. We try to keep it, but it inherently breaks because it is not a mode that FreeBSD cares about (especially in conjunction with third party packages squid, suricata and others).

If you have a small CF card and low RAM this feature is not as useful as it should be, because it severely limits the space available for firmware upgrades. Our system upgrades can be as much as 250 MB, even when zipped and split into individual parts.
Title: Re: The Use of RAM Disks
Post by: Groveld on August 11, 2015, 11:21:42 am
I don't know if i read this wrong, but you're practicly saying that if i can spare it, don't use ramdisk because the updated can be hefty, is that it?
Title: Re: The Use of RAM Disks
Post by: franco on August 11, 2015, 11:42:21 am
It works, you can use it, but it won't help your write cycles too much in bigger/modern SSDs. I see it as more useful for old SD and CF cards.

What I was trying to say: It was a rocky road to get it to that point and we expect further breakage, but that's more of a developer side of things than the user perspective. It works now, but we can't promise this won't change. We don't have the resources to fix an inherent non-focus of FreeBSD for a feature that we provide.

A good example of this are packages in FreeBSD which create directories for services under /var: these will be created on package installation time, but a reboot coupled with /var mount will trash the directories and the services won't work:

https://github.com/freebsd/freebsd-ports/blob/master/www/squid/pkg-plist#L2179-L2182
Title: Re: The Use of RAM Disks
Post by: Groveld on August 11, 2015, 11:51:30 am
Gotcha! Then i keep using my system with ramdisk off, having a modern ssd and all.
I'd rather have a working system than relying on a function that may or may not work properly in the future in case of  missing folders etc. ;)

Thanks for your reply,
Groveld