Use of Swap partition

Status
Not open for further replies.

monarchdodra

Explorer
Joined
Feb 15, 2012
Messages
79
I was wondering what was the point of adding a (2 GiB by default) swap partition on each drive.

Is it just a rule of thumb in the sense of "more space => requires more swap", or is that swap space actually tied to said drive? Wouldn't it be smarter to put it on a dedicated drive?

I have disabled the swap on all 4 of my 1TB drives. It would drive me crazy that they would wake from idle after the first sign of load.

I have, however, attached a flash disc, for random stuff, on which I put 4 GB cache.

My FreeNas server has 8 GB Ram, and it is nothing more than a CIFS file repository.

Just wanted to have a bit of hindsight on how and why the swap is used
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I also have 8GB or RAM and no swap file on my hard drives. I don't feel it's needed for normal use plus I didn't like the idea of having my swap space thrown out on four different drives to which if one failed and my swap space was in use, it could crash the system.

I don't know what the rationale was for picking 2GB per drive and it's not tied to a drive, it's just a place in case the RAM gets too full and it needs to swap.

So my experience is that 8GB is fine without a SWAP space. My opinion is that if you feel you are running out of RAM, I'd either add a cheap swap space on USB Flash (if possible) or add more RAM into your system.

Now lets bring up ZFS V28 and deduplication... If you use this feature as I understand it you will need a lot more RAM and if you used 2GB per drive as a SWAP file, you still might need more. Using swap space in this way will likely slow down the system a lot and run your hard drives a lot harder. I myself will not enable this feature as I wouldn't have many files duplicated in the first place so it doesn't make sense for me to use it. If this was a NAS for my office space where many folks used it, deduplication makes sense because people always make copies of data on the same server.

I hope that answered the question and didn't cause any confusion.
 
Status
Not open for further replies.
Top