Update to 11.1 and lost swap space

Status
Not open for further replies.

Jon Moog

Dabbler
Joined
Apr 24, 2017
Messages
21
After updating to 11.1 some of the swap space allocated on the storage disks is not showing up as swap mirrors and doesn't get enabled. The system has 32 disks with a 2GB partition for swap on each one. The top 10 disks have been automatically mirrored, encrypted and added to swap but the rest are being ignored. I've looked around for guidance on how to manage swap through the middleware in FreeNAS but haven't had much success. Is there any documentation for that mechanism so I can either debug or restore the full swap space?

For the time being I've just mirrored the other partitions and added them to the system (unencrypted) which is working fine but will probably not be ideal in the long run. I'm considering going with some dedicated swap devices for the host and figured if I just drop the automagic FreeNAS approach I can get what I need without burdening the data disks with the task. Is disabling the FreeNAS swap as simple as setting the swap per disk to zero in the GUI or do those partitions have to be destroyed as well?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,466
I've looked around for guidance on how to manage swap through the middleware in FreeNAS but haven't had much success.
There really isn't any management available through the GUI, and I doubt the middleware does anything that way either. Mirrored swap is new with 11.1, but if it isn't using all your disks, that's probably a bug and should be filed as such.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,176
a) Why do you care? Why do you want extra swap?

b) This is on purpose. GEOM doesn't take kindly to massive numbers of mirrors, apparently, so only a portion of the drives is used.
 

Jon Moog

Dabbler
Joined
Apr 24, 2017
Messages
21
a) Why do you care? Why do you want extra swap?

b) This is on purpose. GEOM doesn't take kindly to massive numbers of mirrors, apparently, so only a portion of the drives is used.

Why do I care? Good question. After the latest update system performance has deteriorated considerably for me. Tracking it down it seems the swap policy change is the culprit. The machine was running fine for months and has been extremely unstable since applying the 11.1 update. The symptoms are what you would expect with swap involved, hangs, disk thrashing etc... It was obvious something changed and as I looked into the problem I was trying to understand how the swap is managed in FreeNAS so I could try to debug the problem. Moving to the mirrored swap makes sense from a reliability stand point but the effective drop to half the previously available swap is noteworthy. The second point of encrypting swap is nice for security but I wonder as to the impact on performance as well.

If the purpose of the change is to improve the user experience it would seem to be falling short at least in my case. My work load apparently likes more swap than was available with the new policy (assuming the loss of 2/3rds of the swap space is intended). I've never liked the small swap chunks scattered over the many data disks for a couple of reasons. First the configuration of swap and data on the same disks is generally a point of contention and usually when you can least afford it. Second the reliability of having that many spindles involved in the VM system is a recipe for failure. The mirroring is a nice thought and in my case does work fine so long as I have the full amount of swap available (albeit half what was previously available). The encryption is also nice but I have to say unnecessary in my case and a few knobs in the GUI would certainly be appreciated for more swap control. Actually just an option to leave swap to the user and not do anything automatically would be fine by me. Which gets to my last question about the GUI and setting the value to 0. Does that only effect new volume creation or does it control something more in normal operation.

I've gone the temporary route of dropping the eli mirrored swap created by FreeNAS on boot and manually mirroring the pairs of 2GB partitions and the system is back to working as before. Time will tell but if this continues to work I'm obviously going to need a better solution than manually tweaking things after boot.

BTW I'm running 16 mirrors and seem to be having no issues. What is the thinking behind "massive" numbers? The system was creating 5 and that seems rather low to me. Is this a bug or intended?

Lastly I'm pretty sure I'm going to go the route of adding dedicated swap to this box. The disks are very busy and if paging is necessary it really shouldn't be to the data disks for my needs. While everything worked fine in the past and is once again working with my swap changes I can't help but think dedicated is preferred.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,466
The second point of encrypting swap is nice for security but I wonder as to the impact on performance as well.
Swap was encrypted on earlier versions as well.
Which gets to my last question about the GUI and setting the value to 0. Does that only effect new volume creation
Setting swap to 0 only affects disks added after that change is made.

If your system is regularly using a significant amount of swap, it probably needs more RAM.
 

Jon Moog

Dabbler
Joined
Apr 24, 2017
Messages
21
Setting swap to 0 only affects disks added after that change is made.

If your system is regularly using a significant amount of swap, it probably needs more RAM.

Thanks for the information on the swap setting.

I wouldn't say swap use is regular but sometimes memory pressure gets high and FreeNAS 11.0 and before handled that gracefully and 11.1 was not. The change in behavior seems to coincide with the swap changes in 11.1 and now that I understand those it's just a matter of planning accordingly.
 

JamesWorts

Dabbler
Joined
Apr 29, 2017
Messages
17
I have exactly the same issue after 11.1 update.

I was running 8gb ram and all has been perfect for months.

I upgrade to 11.1 and it crashes within 3 days.

Notice no swap space is used, added another 8gb and still, in reporting avg free space is 72mb! Exactly the same as when I had 8gb - crashed again today - out of memory.

This is definitely a bug.

Without hijacking, please, someone just tell me how to re-enable the swap without the “why do you want it” questioning as the answer is simple.... 11.1 is NOT stable without it!
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,466
Notice no swap space is used
No swap is used, but you believe adding more swap will fix things? Seems like a questionable thought process. But swapon /dev/device will do it.
 
Status
Not open for further replies.
Top