[Plugin] Swapfile for 6.9.1


Recommended Posts

Yeah, we actively encourage authors / maintainers to NOT publish the direct URLs and to instead install everything via Community Applications.  Then there are controls in place to ensure that you only wind up installing stuff that's compatible, works (bugs aside), and is secure.

Link to comment
4 minutes ago, tjb_altf4 said:

A general question about the filesystem swap sits on, as I need to enable this functionality very soon... as pools aren't useable for this, and I will probably add a dedicated drive for swap, is there an optimal filesystem to use for swap ?

I dont really know if one or the other filesystem performs better for swap. I am currently using btrfs and it has been working fine.

  • Thanks 1
Link to comment

I was wondering why the swap wasn't being used, seems the BTRFS file needs to have NOCOW attribute set.

This probably isn't an issue for many as they use existing share that happens to have NOCOW attribute set (and is then inherited), but might be worth explicitly setting for other cases.

 

It looks like NOCOW needs to be set on subvolume, before swapfile itself is added. ( i.e. chattr +C swapfile )

 

image.png.34982297ae003d32eb85d5c025027298.png

Edited by tjb_altf4
Link to comment
16 hours ago, tjb_altf4 said:

This probably isn't an issue for many as they use existing share that happens to have NOCOW attribute set (and is then inherited), but might be worth explicitly setting for other cases.

The plugin should already do this when creating a swapfile on a btrfs filesystem. It should create a new subvolume with the proper BTRFS attributes when the location is set to a BTRFS file system.

Link to comment
4 hours ago, primeval_god said:

The plugin should already do this when creating a swapfile on a btrfs filesystem. It should create a new subvolume with the proper BTRFS attributes when the location is set to a BTRFS file system.

Not sure what the problem was (PEBKAC probably).

I had problems initially when creating it as a subfolder of my pool, so I thought I could only create it at the root of the pool, thats where it couldn't set NOCOW.

I later created it as a subfolder again and is now working as expected.

Link to comment
4 minutes ago, wgstarks said:

Just wanted to ask, will this work on xfs? From what I'm reading it should really be a BTRFS formatted SSD but maybe I'm just not understanding the conversation.

Both this plugin and its precursor work just fine on xfs. The reason there is so much talk of BTRFS in this thread is that this newer plugin also supports BTRFS where the previous version did not. 

Edited by primeval_god
Link to comment
8 hours ago, primeval_god said:

Both this plugin and its precursor work just fine on xfs. The reason there is so much talk of BTRFS in this thread is that this newer plugin also supports BTRFS where the previous version did not. 

Does using an array share cause issues with read/write speeds? My easiest setup would be to just create a share on the unraid array but I could also attach an external drive via USB2. Both seem rather slow to me and I'm not sure if that would cause issues or not?

Link to comment
2 hours ago, wgstarks said:

Does using an array share cause issues with read/write speeds? My easiest setup would be to just create a share on the unraid array but I could also attach an external drive via USB2. Both seem rather slow to me and I'm not sure if that would cause issues or not?

Putting the swapfile on the array is not a recommended configuration. For one it will tend to keep the disk it is on spun up at all times (and thus also parity). I am not certain if the plugin code explicitly forbids the configuration but I would advise against it. I have used a USB2 flash drive for mine in the past, it works ok but the speed of the drive is not great. In such a configuration i recommend settings swappiness to very low or even zero so that the system will tend not to use swap unless memory pressure demands it. One other warning though, flash drives are not the highest quality flash memory and heavy swap usage on one will tend to wear it out fairly quickly (Not an issue with SSDs). 

  • Thanks 1
Link to comment
15 minutes ago, primeval_god said:

One other warning though, flash drives are not the highest quality flash memory and heavy swap usage on one will tend to wear it out fairly quickly (Not an issue with SSDs).

It wouldn’t be a flash but rather a spinner in an enclosure. I’ve got a bunch of old 3.5” drives and enclosures just laying around. Thanks for the info.

Link to comment
28 minutes ago, wgstarks said:

I’ve got this plugin setup and running. The delete swap file on stop is set to “No” by default so I left it that way. Just wanted to confirm that no is the best setting?

No is the settings that i use. As to what is the best, i am not really sure. I am not certain of the specific use-case of deleting the swapfile on stop. I am not the original author of the swapfile plugin and i am not completely familiar with the history of all of its options.

  • Thanks 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.