Does Swap have to be activated?

AVB

Contributor
Joined
Apr 29, 2012
Messages
174
My FreeNas box is just media server, albeit a pretty large one. I was doing some transfers from another computer that totaled about 2TB. When it was over I looked at some of the reports and saw the swap usage was zero. All my discs have the regular installed 2GB of swap and the total swap size shown is 10GB which I don't understand either since there are 18 drives in the pool comprised of 2 vdevs in a RaidZ2 configuration. I would think the swap should be 28GB. This box has 64GB of memory and it was shown to be maxed out during the copying process. I thought, perhaps mistakenly, swap would be used when memory was maxed out.

My backup box which only has 32GB of memory also shows 10GB of swap with none being used no matter what the load.

My questions are: Should I see some swap usage or not? If I am supposed to see some swap usage how do I know if it is on and is it something I have to turn on - if so where?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
If you have enough RAM... and that's a must for FreeNAS... swap use is rare to non-existant.

FreeNAS will only select 5 disks to use in the swap drive in any session (selected "randomly" at every boot).

Swap is there to handle extreme situations. If you disable it (there are some guides out there which suggest ways to do it), your box will simply kernel panic instead of swapping, so if you want to look into that and do it, fine.

2GB is nothing on a multi-TB disk, so I don't lose any sleep over it.
 

AVB

Contributor
Joined
Apr 29, 2012
Messages
174
Thank you for the reply. If 64GB isn't enough I just ordered another 32GB for both the main box and backup box which will take me to 96 and 64GB respectively. I wasn't worried about the 2GB on the discs. I was just wondering why it was never used even though memory was maxing out. Maybe on the next disc upgrade I'll play with making the swap larger and see if that does anything.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Swap is terrible for performance. Using disk instead of RAM isn't something that you want to try to do. Maxing out RAM with cache (ARC) means that more space in RAM will always be provided by dumping the least useful blocks from the cache, so no need to swap.
 

AVB

Contributor
Joined
Apr 29, 2012
Messages
174
While I just upgraded to 96GB of ram it would take a while monetarily to max out the system at 256GB of ram. I am trying to stay at or near the 1GB memory for every TB of disc space recommendation (54TB usable now, 72TB by end of next year) but I don't know if I need to try and squeeze out more performance with an ARC. It is only a media server and I can play 3 blu-ray ISOs simultaneously now. Perhaps once I start ripping 4K stuff I'll need to reconfigure the entire system to fit in 2 ARC drives (one for each pool) but right now all 24 slots have drives plus the 2 drive caddy on the interior is holding the boot drives. Thank you for the advice, it is something I will have to consider at some point in the future.
 
Top