FreeNAS 11 - how to add swap space?

Status
Not open for further replies.

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Hi, all,

I just ordered a small not too expensive NVME SSD for my home NAS. I plan to put ZIL, L2ARC and swap on that drive and subsequently remove the swap partitions from my hard disks.

Will FreeNAS discover and activate every partition of type freebsd-swap automatically or is there a magic incantation to make this work?

Thanks!
Patrick
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
FreeNAS doesn't seem to magically find the swap, but there are a few ways to activate it. One that I like is to simply find the gptid of your swap partition and then add a pre-init command

swapon /dev/gptid/etcetc

Another method is to echo into the fstab and then reload the swap.

Putting l2arc and slog on the same ssd is normally not a good idea. The l2arc slows down the slog.

Also does your ssd have PLP?
 
Last edited:

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Hi, all,

I just ordered a small not too expensive NVME SSD for my home NAS. I plan to put ZIL, L2ARC and swap on that drive and subsequently remove the swap partitions from my hard disks.

Will FreeNAS discover and activate every partition of type freebsd-swap automatically or is there a magic incantation to make this work?

Thanks!
Patrick
You don't need a l2arc and you probably don't need a slog. Also swap is not in your pool to be used. It's there incase you replace a disk that is a little different size.

So basically stop everything your doing because it won't solve whatever problem you think you are solving.

What is your problem?

Sent from my Nexus 5X using Tapatalk
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
I set a limited size for ARC because I run bhyve VMs on that machine and I thought having an L2ARC might just "speed up" the system ... at least that's what all the documentation says.

Patrick
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
I set a limited size for ARC because I run bhyve VMs on that machine and I thought having an L2ARC might just "speed up" the system ... at least that's what all the documentation says.

Patrick
It could speed up the system. But it could also slow it down. A l2arc uses memory so that means less arc from memory which is faster than l2arc. So you better make sure you have plenty of ram, 64GB+, or be really good at testing to know the limits and impact it has on the system.

Sent from my Nexus 5X using Tapatalk
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
I have 32G of RAM. And after reading posts like this one https://forums.freebsd.org/threads/58097/#post-332116 I had the impression that dedicated L2ARC and SLOG was always a good thing. Seems like I need to revise that.

Patrick
That post is saying the exact same thing as me. Max out your memory before adding l2arc because it's faster and adding it will use memory.

Slog is only useful for sync writes and doesn't even get used in other scenario.

Sent from my Nexus 5X using Tapatalk
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
I have 32G of RAM. And after reading posts like this one https://forums.freebsd.org/threads/58097/#post-332116 I had the impression that dedicated L2ARC and SLOG was always a good thing. Seems like I need to revise that.

Patrick

There is only so much sustained write bandwidth to your slog/l2arc drive and this will range from 100MB/s (normal) to 1GB/s (very best write optimized drive). The l2arc and slog drives get written to simultaneously. In my testing with almost the very best slog drive you can get (intel P3700), I found putting l2arc on the same disk as the slog slowed down sync writes.

Good slog drives are expensive, where as any old ssd can be an l2arc.

Anyway, I'm planning to test it again, because as the post you linked mentions, you *should* be able to use a high performance NVMe device as both.
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
FreeNAS doesn't seem to magically find the swap

Actually this is not true. If you do it right, then it does. I'm not sure exactly what it is, but if you follow the recipe you end up with swap -b 128 from the base of the drive, and then a ZFS partition. Not sure if the partition or the b 128 is necessary, but FreeNAS will then automatically find the swap, use from to encrypt it, and start using it. Neat.

Anyway, I'm planning to test it again, because as the post you linked mentions, you *should* be able to use a high performance NVMe device as both.

I've now setup my P3700 as swap/slog/l2arc and so far there seems to be no performance impact to having l2arc and slog on the same high performance NVMe. The drive is set to 4Kn and max LBAed to 100GB (out of 400) and I have swap at 16GiB, SLOG at 20GiB and l2arc the rest (57GiB?). I was hoping for 16/20/64, but it turns out gpart uses GiB instead of GB.

Seeing 750-1000MB/s for sustained sync writes. Highest utilization has been 70% during the 1GB/s test. If I had a higher read/write load the l2arc might affect it, but I think the capacity of this NVMe outstrips my servers caapacity (just :))
 
Last edited:
Status
Not open for further replies.
Top