Enable SWAP

Status
Not open for further replies.

mikefazz

Cadet
Joined
Mar 7, 2012
Messages
6
I have a work server I setup with 8 2TB WD green HDD's using zfs raidz2. I had to change out 3 of the initial HDD as they had died. To replace the HDD's I partitioned them using GParted since I couldn't switch out HDD's by having the freenas box replace them. When using GParted I had to make their SWAP size a little smaller than the other HDD from the original pool.

My problem is that no SWAP space shows up even though I should have about 16GB of swap space. My system only has 8GB or ram (the max the MoBo can support) which is below the desired ~11GB suggested by the sources I have found (in hindsight). I have set some tuning variables:

vm.kmem_size 7500
vfs.zfs.arc_max 6000

Which keeps the system from freezing up but I would like to know how to get the SWAP working to hopefully get some faster transfers.

I know the SWAP is not setup because there is nothing showing with the TOP command and the GUI shows none used.

swapctl -A doesn't seem to enable the swap
 

peterh

Patron
Joined
Oct 19, 2011
Messages
315
swapctl -A only enables swap mentioned in /etc/fstab.

If you really need swap use a dedicated disc for this.
But if this is a pure fileserver i doubt that you need neither swap nor tuning.
 

mikefazz

Cadet
Joined
Mar 7, 2012
Messages
6
Thanks for the help,

I'm using the latest:
FreeNAS-8.0.4-RELEASE-x64 (10351)

The array was made in a previous version (8.0.1) I think then HDD were replaced maybe in 8.0.2.

Running "diskpart list" the swap partitions (FreeBSD swap) are either:

2146279936
or
2147483648
in media size.

In general transfer speeds are around 10MB/s over CIFS with lots of small files on a gigabit network. It is mostly used for data backup and access so reliability is of primary concern but more speed would be nice. Transferring large AVI files over CIFS I can get 70MB/s so I don't suspect a network issue. From what I have read about ZFS you can never have too much RAM especially when dedup is used (5GB/1TB of memory I have heard).

So do I need to do something to manually create an 'array' of the raid partitions and then enable them so ZFS can use the space?

Mike
 

peterh

Patron
Joined
Oct 19, 2011
Messages
315
Why do you think you need swap ?
Ahh, did i read that you use dedup ? I umderstand. Anyone using dedup a-la zfs will find the there is
not enough memory and that everyting happens veeeeeerrrryy slooooow.
 

mikefazz

Cadet
Joined
Mar 7, 2012
Messages
6
Peter,

I don't use dedup that was just a consideration for the future (when freenas supports the higher version of ZFS). From what I have read it is good practice to have 1GB or memory for every 1TB of storage + 1GB for the OS. I have a 10TB of usable space so 11GB of memory would be needed yet I only have 8GB of memory. I have a smaller freenas box at home with 4GB or memory for 2TB of usable space and it uses swap. I was able to get 30MB/s transferring from it to a tablet (SSD drive) so that box seems to have better performance.
 

peterh

Patron
Joined
Oct 19, 2011
Messages
315
I'm not convinced that even a 4GB machine should need swap ( unless som tuning is done ) or some
memory-hungry applications is running.
Does pstat -s show swap usage ?

If you are seeking for better performance you are looking up the wrong tree
 

mikefazz

Cadet
Joined
Mar 7, 2012
Messages
6
I agree that SWAP is not a good replacement for RAM but is SWAP completely worthless?

Under Hardware requirements they mention performance will be affected by not having enough RAM ... SWAP isn't mentioned.
http://doc.freenas.org/index.php/Hardware_Requirements

Whenever we do upgrade the box I will make sure to get a MoBo that supports much more RAM.
 

peterh

Patron
Joined
Oct 19, 2011
Messages
315
I think it was seymore cray that said that "memory is like ***, only the real thing counts"
Swap is a last resort to copy with transient conditions. On hpc ( and fileserver operations) one
wants to have everything "in core" and nothing "in trash" ( as swapping will take valuable cycles
from the task at hand. For a fileserver it could be even worse if swap is done on the same
volumes as storage as they will interfere both with cpu cycles and with disk accesses)

But for small machines that might encounter transient memory needs swap is the only way to stay alive.

Hmmm, replace the "***" above with the word spelled S + E + X
 
Status
Not open for further replies.
Top