Does the Swap-Partition one day let your FreeNAS crash?

Status
Not open for further replies.

Scampicfx

Contributor
Joined
Jul 4, 2016
Messages
125
Dear guys,

I'm a bit unsure regarding SWAP partition!

I read many postings here in the forums and while some postings recommend to disable SWAP, some others encourage to leave it enabled.

In this posting (https://forums.freenas.org/index.ph...talled-freenas-in-usb-disk.49865/#post-343367), Spearfoot recommends to give FreeNAS some swap space - regardless of how much memory is installed in the system. Furthermore, the GUI itself strongly discourages from disabling SWAP. Okay, fine, so I will leave Swap enabled! (although this gives me tons and tons of SWAP)

BUT, the reason of thinking about disabling SWAP is, because I am concerned about what happens when the disk, which houses the actual used SWAP-partition, fails. And it is only a matter of time: one day, every hdd will fail! So this is no theoretical question!

So, while continue reading, I came accross this thread: https://forums.freenas.org/index.php?threads/further-explanation-of-partitions-swap-on-disks.26231/

It's a good source of information. However, still some questions remain unanswered.

Talking about replacing disks, the guys in this thread recommend to disable SWAP first or "offline a disk" or power down the system and THEN replace the affected disk. The reason for this recommendation is, that unplugging a disk suddenly - while it is used as SWAP - may lead to a system crash.

Okay... But what happens, when I can't control this procedure? Let's say, the affected disk itself powers off becauses it is damaged? What happens in this case? I have no control at this point!

My FreeNAS OS is running on two mirrored SSDs. They have plenty of unused space. Is it possible to place SWAP-partition on this vdev? I don't want to place SWAP partition on every single disk. I would rather prefer to have SWAP mirrored, so that in case of SSD-crash the SWAP-partition does not get affected!

In the thread mentioned above, there is user embrais is building his own swap-file on a vdev. By creating a file and not a partition, he gains mirroring and redundancy. Okay... this sounds like a good solution....

But, the point I would like to ask:
By reading all the postings, I get the feeling that it is only a matter of time, when FreeNAS gets affected severely by a ssd or hdd failure. Why don't the devs provide any options in the GUI to solve this problem? Why don't I get some options to decide where to place the Swap-file / Swap-partition.
As mentioned above, this is no theoretical question. Every drive will fail - some after a few months, some after a couple of years! And these drives host the swap partition! The point is, that each time a hard drive fails, it could also completely destroy the SWAP partition. And one time, when the system is using the swap partition exactly at that moment the disk error occurs, it could lead to a system crash of FreeNAS. The GUI itself does not provide any options to solve this issue. So, I'm wondering why this is accepted as it is?

My impression is, that a dev should fix all critical issues he knows about. When I am coding projects myself, I always try to do so! I couldn't go to sleep knowing that there a possible critical problems in my software which could lead to a system crash and in worst cases to a loss of data? When I know there is an issue, I put in my best efforts to solve it as fast as possible.

So, to come to a conclusion, I'm wondering, if I understand this whole SWAP-thing correctly? So please give me a hint or advise, if I'm wrong with my assumptions above! I hope I am wrong :)

Thank you guys!
 
Last edited by a moderator:

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
Swap can be a complicated thing. It is not generally a problem. FreeNAS 11.1 uses mirrored swap, so an individual disk failure is less of a concern.

Okay, fine, so I will leave Swap enabled! (although this gives me tons and tons of SWAP)
2G per drive is not really that much. 0.1% of a 2TB drive, or about a thousandth of the capacity.

Let's say, the affected disk itself powers off becauses it is damaged? What happens in this case? I have no control at this point!
But neither does FreeNAS have any control over that. Mirrored swap addresses that also.
 

Scampicfx

Contributor
Joined
Jul 4, 2016
Messages
125
Guys, I'm a bit drunk right now. But I just want to tell you that you all are awesome :D Thanks for this info! So have a good night :D
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
Mirrored swap was originally going into the 10.x releases, (with the name that shall not be uttered). I was happy to see it, but then 11.0 came out without mirrored swap.

So I too am glad to hear 11.1 has that resolved.

Makes me want to upgrade from the 9.10.x release I am still running.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
Mirrored swap was originally going into the 10.x releases, (with the name that shall not be uttered). I was happy to see it, but then 11.0 came out without mirrored swap.

So I too am glad to hear 11.1 has that resolved.

Makes me want to upgrade from the 9.10.x release I am still running.
Come on in, the water is fine.

Sent from my SAMSUNG-SGH-I537 using Tapatalk
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Actually, wait until 11.1-U1. Unless you're okay with scrubs deadlocking with large asynchronous deletes and memory leaks when issuing TRIM and disk cache flush commands (and possibly more).
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
Actually, wait until 11.1-U1. Unless you're okay with scrubs deadlocking with large asynchronous deletes and memory leaks when issuing TRIM and disk cache flush commands (and possibly more).
What is this?

Sent from my SAMSUNG-SGH-I537 using Tapatalk
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Last edited:

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
Please continue discussion about non-swap issues in those other threads, thanks.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080

Scampicfx

Contributor
Joined
Jul 4, 2016
Messages
125
Hey Chris,

I just had a look... In Server A there are 6x 6 TB drives + 6x 10 TB drives + 2x SSD (i think 120 GB). In Server B there are 9x 8TB drives... Well, I have to admit, it is not "tons" ;)

Thanks for all the info so far!
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
Hey Chris,

I just had a look... In Server A there are 6x 6 TB drives + 6x 10 TB drives + 2x SSD (i think 120 GB). In Server B there are 9x 8TB drives... Well, I have to admit, it is not "tons" ;)

Thanks for all the info so far!
If you do make the upgrade to 11.1, the amount of swap is cut in half because it mirrors the available swap partitions with an adjacent drive. So, in my system that has 16 drives, I had 32GB of swap before and now I only have 16GB. Still, more than I need, but it has been working mostly reliably. I did have to replace a drive for bad sectors since I made the upgrade and everything went smoothly except the mirror of the swap was not re-established. It cleaned itself up on the next reboot though.

Are you already using FreeNAS or are you trying to decide whether or not to move existing servers (currently on another OS) over to FreeNAS?
 
Joined
Jan 18, 2017
Messages
525
I did have to replace a drive for bad sectors since I made the upgrade and everything went smoothly except the mirror of the swap was not re-established. It cleaned itself up on the next reboot though.

did you make a bug report for that?
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080

Scampicfx

Contributor
Joined
Jul 4, 2016
Messages
125
Hi Chris,
Both servers mentioned above are running with FreeNAS already. One day, both FreeNAS servers shall replace our oldest server with Win 2008 R2 and H/W-raid. This windows-server is already too old.

One question: Is there a possibility to force the placement of both mirrored swap partitions to a certain zpool? Personally, I would like to keep the swap partitions away from the storage zpools. I would prefer to place the swap partitions to the system zpool which consists of one vdev with two mirrored ssds with high URE ratio.

By the way: There is one ESXi server connected directly to the primary FreeNAS server using iSCSI. When there is a lot of load on the san-zpool (caused by ESXi), I notice that the WebGUI gets extremely slow... Could this be related to this SWAP-thing? Is there any possibility that any files of the WebGUI are stored on this zpool? When looking at the processes, I notice that nginx is pretty high (75% usage). But well, most probably this is a different topic...

Thanks so far!

EDIT: Congrats to post 2000!
 
Status
Not open for further replies.
Top