How much RAM for ZFS?

Status
Not open for further replies.

Vyal

Cadet
Joined
Jul 19, 2014
Messages
2
Hi, is it that we need minimum 8 GB RAM no matter what is our SSD or HDD capacity or it depend upon our disk capacity (1GB per TB), I am confused :(

I am getting a server or two from Vultr and would have to choose between Scientific Linux and FreeBSD. Here are the 3 plans I can get:
1. 768 MB RAM, 15 GB SSD storage, 1 CPU
2. 1024 MB RAM, 20 GB SSD storage, 1 CPU
3. 2048 RAM, 40 GB SSD storage, 2 CPU

Is any or all of the above capable of running FreeBSD or FreeNAS well without performance issues?
 

Sasayaki

Explorer
Joined
Apr 20, 2014
Messages
86
The short answer is: No, none of those are suitable for FreeNAS with ZFS. ZFS assumes that the OS will require at least one GB of ram on its own; this immediately discounts options #1 and #2. With UFS only, option #3 meets the minimum requirements, but again, this is without ZFS.

Because ZFS uses a lot of features such as end-to-end checksumming that dramatically increase the amount of writing the system has to do to the disk when compared to "dumb" file systems like EXT3 or NTFS, it attempts to recover some of that performance by aggressive caching. Much of the metadata for the drive is kept in memory, as is pool data, and a whole bunch of "stuff". The filesystem assumes 8gb of total RAM and if you try to use less than this, you may run into weirdness like the web interface crashing because the tiny fraction of memory allocated to it is insufficient.

From the manual:

FreeNAS® with ZFS requires a minimum of 8 GB of RAM in order to provide good stability regardless of the number of users or size of the pool.

This post (http://hardforum.com/showpost.php?s=8d31305e57c1dd2853eb817124ff18d9&p=1036865233&postcount=3) will give a lot of insight into how FreeNAS uses RAM.
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
FreeNAS in the cloud? How exactly do you expect to add hard drives to a vps?
 

c32767a

Patron
Joined
Dec 13, 2012
Messages
371
Hi, is it that we need minimum 8 GB RAM no matter what is our SSD or HDD capacity or it depend upon our disk capacity (1GB per TB), I am confused :(

I am getting a server or two from Vultr and would have to choose between Scientific Linux and FreeBSD. Here are the 3 plans I can get:
1. 768 MB RAM, 15 GB SSD storage, 1 CPU
2. 1024 MB RAM, 20 GB SSD storage, 1 CPU
3. 2048 RAM, 40 GB SSD storage, 2 CPU

Is any or all of the above capable of running FreeBSD or FreeNAS well without performance issues?

As others have said, available RAM is tied directly to ZFS' caching mechanisms, which directly affects performance.
FreeBSD only lists a minimum of 1Gb of RAM to run ZFS, so you could always opt for FreeBSD instead of FreeNAS.

Just be aware that when you have less RAM, memory contention is more likely. When there is contention, ZFS will release some of the ram it's using for cache back into the free pool. But, ZFS will not release cache memory back to the free pool until the contents are flushed to disk. So there is a chance the system will run out of free memory before the cache pages are flushed and freed. This starvation can lead to other processes dying when they can't allocate additional RAM, or at worse, a kernel panic.

With proper kernel tuning you can have some protection, but depending on your workload, there is always a chance you could put the system into memory starvation.
 

Knowltey

Patron
Joined
Jul 21, 2013
Messages
430
Absolute bare minimum is 4GB, any less than that and you're just waiting for the explosion. Bare minimum for reliable stability is 8GB. Also note that for any reliability this needs to be ECC RAM as well, otherwise the moment your DIMM goes bad you're gone.

Also why do you need the storage to be on an SSD exactly? Take the money you are spending in the SSD, get an HDD instead and use the savings to get more RAM.

(And yes, while FreeNAS will allow you to boot with less than those minimums it is a situation of "just because you can does not mean you should."
 

c32767a

Patron
Joined
Dec 13, 2012
Messages
371
Guys, the OP is asking about setting up freenas on a vps.

Yep. Which is why I mentioned FreeBSD and also pointed out there are tunables that might allow him to run FreeNAS in a small memory config, but with a lot of risk.
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
Yep. Which is why I mentioned FreeBSD and also pointed out there are tunables that might allow him to run FreeNAS in a small memory config, but with a lot of risk.
But considering a VPS is VIRTUAL, and there is no access to the physical hardware by the user, we need to steer the OP away from even considering it.
If you got drives added to a VPS, they will be virtual(99% of the time)
Running virtual is a really bad idea in general for an appliance that expects direct hardware access.

This is a bad idea.
 

Knowltey

Patron
Joined
Jul 21, 2013
Messages
430
Oh didn't notice the virtual part. Yeah, you should only ever run FreeNAS on bare metal, it is known to not play nice with being virtualized.
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
Guys, the OP is asking about setting up freenas on a vps.
Lol, I was just waiting to see how many posts the thread will collect until someone mentions the virtual issue.
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
It was the third post but nobody was reading that part.... :)

#stayparanoid
Ah now I see it. The vps part was so subtle that I didn't notice ;). Actually, now that I've reviewed the thread, it took you three posts until you got someone to directly address it.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Oh yeah! Well, your face is stupid! :P
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
But... but... I have dog face... and dog face is cute!
 
Status
Not open for further replies.
Top