Remove SWAP from drives

Status
Not open for further replies.

Scharbag

Guru
Joined
Feb 1, 2012
Messages
620
Is there any way to remove the SWAP from drives within a pool?

I am virtualizing FreeNAS via ESXi and I do have a 4GB swap on the boot volume which is stored on an SSD that FreeNAS boots from. I have resilvered my pool with new drives that have no swap but a few of the drives in the pool still have swap on them. Is there an easy way to get rid of the extra swap files?

I have only seen a max of 297M of swap used one time, 1.2M is the average in the last month, nothing in the last while.

Cheers,
 
J

jkh

Guest
There's no way to remove it once they have been partitioned, but you can always recreate the pool with the swap size parameter (it's in the UI) set to 0 and there will be no swap on the pool drives after that.
 

Scharbag

Guru
Joined
Feb 1, 2012
Messages
620
Thought that may be the answer. I think another way would be to resilver all of the 4TB drives that have a swap partition on them, 1 at a time, and once that is done, the swaps should be all gone. I arrive at this conclusion from the results of gpart which show only some of the drives in my production pool have swap on them. Does this make sense?

Cheers,
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
Set the swap parameter to zero. Offline a drive. Wipe it. Replace it with itself
 

Scharbag

Guru
Joined
Feb 1, 2012
Messages
620
Set the swap parameter to zero. Offline a drive. Wipe it. Replace it with itself
I have a spare, so I can just replace, wipe, replace repeat right?
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
Yes. Might want to start by wiping the spare ;)
 

Scharbag

Guru
Joined
Feb 1, 2012
Messages
620
Yes. Might want to start by wiping the spare ;)
Spare is wiped. Found that out the hard way on my backup pool as a resilver did not automatically start cause there was ZFS info on the spare that wanted a human to say yes at a prompt... Lesson learned.
 

Scharbag

Guru
Joined
Feb 1, 2012
Messages
620
7 drives needed to be resilvered out of the pool to remove the swap. 4 down. 3 to go. I am certainly exercising this pool over the last month or so!!
 

Scharbag

Guru
Joined
Feb 1, 2012
Messages
620
Not sure why my production pool resilvers like it does. Starts super fast, slows down for a while and then finishes strong.

It takes 20 hours +/- a few minutes every time. My backup pool takes about 6 hours.
 

Attachments

  • Screen Shot 2016-11-18 at 9.03.04 AM.png
    26.1 KB · Views: 258

droeders

Contributor
Joined
Mar 21, 2016
Messages
179
Not sure why my production pool resilvers like it does. Starts super fast, slows down for a while and then finishes strong.

My guess would be the size of the files it's resilvering. If I had to wager, I'd say it's resilvering large files when the performance is high, and lots of small files during the slow periods.
 

Scharbag

Guru
Joined
Feb 1, 2012
Messages
620
My guess would be the size of the files it's resilvering. If I had to wager, I'd say it's resilvering large files when the performance is high, and lots of small files during the slow periods.
But my backup tank has all the same data on it and it averages over 900MBps... Oh well. Not a big deal.

Cheers,
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
My guess would be the size of the files it's resilvering. If I had to wager, I'd say it's resilvering large files when the performance is high, and lots of small files during the slow periods.
Wouldn't resilvering iterate over blocks? Not files?

Is the pool greatly fragmented? There is work being done to improve resilvering: https://www.youtube.com/watch?v=SZFwv8BdBj4
 

droeders

Contributor
Joined
Mar 21, 2016
Messages
179
Wouldn't resilvering iterate over blocks? Not files?

Is the pool greatly fragmented? There is work being done to improve resilvering: https://www.youtube.com/watch?v=SZFwv8BdBj4

I don't think it's that simple. Since ZFS only resilvers disk blocks that are in use, I would expect it to do some type of filesystem walk (rather than just go from the first LBA to the last like a traditional RAID).

This article talks about "Sequential Resilvering", where random small IO was killing ZFS resilvers until they broke up the process into two phases. In the first phase, the list of blocks that need resilvering is generated, and in the second phase, the blocks are sorted and grouped together allowing for much more efficient usage of the spindle.

https://blogs.oracle.com/roch/entry/sequential_resilveringfirst

I didn't have time to watch the video you referenced - maybe it's talking about the same thing.

All that said, if the OP isn't seeing the same performance with a similar machine holding the same data, it's probably something else.
 

Scharbag

Guru
Joined
Feb 1, 2012
Messages
620
My scrub performance with the production pool being discussed has always been slower than the backup pool. And it acts the same on 2 different servers. Not a big deal given it is for home use.

Cheers,
 
Status
Not open for further replies.
Top