[Plugin] Swapfile for 6.9.1


Recommended Posts

6 hours ago, Zeench said:

While you guys were writing about the size.

I put mine  to 10GB, it doesnt have negative side effects to have it this big, right?

Other than taking up disk space none that I am aware of. The plugin has been known to struggle to format large swapfiles, basically the gui hangs or the operation fails waiting for swapfile creation to complete. I dont think thats your case though as the swapon command seems to show a functioning swapfile.

 

Also did you say what version of unRAID you are running?

Edited by primeval_god
Link to comment
6 hours ago, Zeench said:

image.png.20c20915a518c83328c35f5752a31d79.png

I put mine  to 10GB, it doesnt have negative side effects to have it this big, right?

Actually, something i just noticed, your swapfile size is set to 10 MB not GB. Couple of things for you to try if you would. Could you verify that the fields for location, filename, and swap name contain no extra whitespace at the end? Additionally please re-specify your swapfile size using only digits (no . or , etc).

 

On 7/26/2023 at 11:30 AM, Zeench said:

image.thumb.png.b1a7a5411708f0f1d4de714c1c22c3e2.png

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

Actually, something i just noticed, your swapfile size is set to 10 MB not GB. Couple of things for you to try if you would. Could you verify that the fields for location, filename, and swap name contain no extra whitespace at the end? Additionally please re-specify your swapfile size using only digits (no . or , etc).

 

Ty very much for that good support here. 

Its working now, wasnt a blank, it was the "slash" in the location...

Now its working just fine.

image.thumb.png.c7c0b2d02c42678447cf3434fc1c97ad.png

Edited by Zeench
Link to comment
  • 1 month later...

I just installed and am having some issue trying to get this to work. I am hoping you may be able to help. I click start and it creates the appropriately sized swap file, but it doesn't actually start the swap. I read through some other posts, here is some information that hopefully is helpful.

 

Unraid Version: 6.12.4

Assigned swap file to an NVME cache drive.

Output of "swapon -s" is blank.

 

System Log:

Oct  1 11:02:25 Computer kernel: swapon: swapfile has holes
Oct  1 11:02:25 Computer rc.swapfile[11716]:  Swap file /mnt/user/NVME/swap/swapfile re-used and started
Oct  1 11:02:25 Computer rc.swapfile[11717]: Setting swappiness to 1

 

Screenshot of my settings.

 

Thank you very much!

Screenshot 2023-10-01 at 11-08-00 Korriban_swapfile.png

Link to comment
2 minutes ago, Bovive said:

I just installed and am having some issue trying to get this to work. I am hoping you may be able to help. I click start and it creates the appropriately sized swap file, but it doesn't actually start the swap. I read through some other posts, here is some information that hopefully is helpful.

 

Unraid Version: 6.12.4

Assigned swap file to an NVME cache drive.

Output of "swapon -s" is blank.

 

System Log:

Oct  1 11:02:25 Computer kernel: swapon: swapfile has holes
Oct  1 11:02:25 Computer rc.swapfile[11716]:  Swap file /mnt/user/NVME/swap/swapfile re-used and started
Oct  1 11:02:25 Computer rc.swapfile[11717]: Setting swappiness to 1

 

Screenshot of my settings.

 

Thank you very much!

Screenshot 2023-10-01 at 11-08-00 Korriban_swapfile.pngwhat file system is your cache drive 

 

Link to comment
On 10/1/2023 at 9:34 PM, primeval_god said:

Looks like you are using a user share path instead of a disk share path. Make sure the path to your swap file is directly via the nvme disk share. Also delete both the swap file and the folder it is in before re-specifying the path. I think the help text may have a note about that.

 

Thank you, that absolutely was the case and fixed it right up. Much apprecaited!

Link to comment
  • 3 months later...

Edit : fixed the issue myself. I had to do several things :

- backup cache files

- stop array

- delete cache pool

- remove 1 cache drive (don't think i need 2 anyway)

- reformat the remaining cache drive to XFS (was BTRFS)

- restart array

- recreate cache shares because everything was missing (had backup for that)

- reconfigure swapfile plugin to cache drive as shown :

image.thumb.png.cf0953d9fad625ce4c5aa3759c498dbf.png

 

It works !

 

Quote

 Hi I just installed swapfile but don't think it's working.

I'm on 6.12.6

 

Jan 23 18:04:56 SRVBRUH root: plugin: running: anonymous
Jan 23 18:04:56 SRVBRUH root: plugin: creating: /boot/config/plugins/swapfile/swapfile-package-2023.04.23b.txz - downloading from URL https://github.com/dcflachs/swapfile_plugin/releases/download/2023.04.23b/swapfile-package-2023.04.23b.txz
Jan 23 18:04:57 SRVBRUH root: plugin: checking: /boot/config/plugins/swapfile/swapfile-package-2023.04.23b.txz - MD5
Jan 23 18:04:57 SRVBRUH root: plugin: running: upgradepkg --install-new /boot/config/plugins/swapfile/swapfile-package-2023.04.23b.txz
Jan 23 18:04:57 SRVBRUH root: plugin: running: anonymous
Jan 23 18:04:58 SRVBRUH root: plugin: running: anonymous
Jan 23 18:04:58 SRVBRUH root: plugin: swapfile.plg installed
Jan 23 18:07:20 SRVBRUH emhttpd: cmd: /usr/local/emhttp/plugins/swapfile/scripts/rc.swapfile updatecfg true false /mnt/disk4 swapfile UNRAID-SWAP 10240 60
Jan 23 18:07:21 SRVBRUH rc.swapfile[23205]: Plugin configuration written
Jan 23 18:07:27 SRVBRUH emhttpd: cmd: /usr/local/emhttp/plugins/swapfile/scripts/rc.swapfile start
Jan 23 18:07:27 SRVBRUH rc.swapfile[23475]: Creating swap file /mnt/disk4/swapfile please wait ...

 

image.thumb.png.265c94526fa81338ce3876e3c8f6b7e7.png

 

I chose /mnt/disk4 as a location (xfs) because i have 2 cache drives and read it would not work.

image.png.965763cccceb195a8544bf941a4401cf.png

image.png.2bd0ef4c9940a2d725c1e5477d3521fc.png

 

Also, Is there a reason why text is overlapping?

 

Thanks

 

Edited by theosusan
Link to comment
On 1/23/2024 at 12:15 PM, theosusan said:

Edit : fixed the issue myself. I had to do several things :

- backup cache files

- stop array

- delete cache pool

- remove 1 cache drive (don't think i need 2 anyway)

- reformat the remaining cache drive to XFS (was BTRFS)

- restart array

- recreate cache shares because everything was missing (had backup for that)

- reconfigure swapfile plugin to cache drive as shown :

...

It works !

 

 

I am glad you got it working. I dont think you needed to go through all that just to get swap working, but having swap on an array disk is not ideal so it may be better that you did. My guess us that the issue was your 10GB swap file size. This plugin struggles creating large swap files as the webui portion can time out before the underlying file operations complete. You could likely have created the file from the terminal then started it from the plugin just fine. 
p.s. as to why putting the swapfile on the array is not a recommended configuration, it will tend to keep the disk it is on spun up at all times (and thus also parity).

Link to comment
  • 4 weeks later...
On 1/24/2024 at 8:43 PM, primeval_god said:

... This plugin struggles creating large swap files as the webui portion can time out before the underlying file operations complete. You could likely have created the file from the terminal then started it from the plugin just fine. 

 

  • Like 1
Link to comment
22 hours ago, primeval_god said:

 

So it really was out of luck that 10000 worked and 10001 failed !

 

 

I searched and found on this topic some indications to use the terminal :

 

 

dd if=/dev/zero of=/mnt/ssd/swap/swapfile bs=1M count=32768
btrfs property set /mnt/ssd/swap/swapfile compression none
mkswap -L swapfile /mnt/ssd/swap/swapfile
chmod 600 /mnt/ssd/swap/swapfile
swapon -v /mnt/ssd/swap/swapfile

 

Would you mind validating that this matches the settings bellow ? :)

765377615_Screenshot2024-02-21at09_10_10.thumb.jpg.3c8541d4ff75b0b90973d117add7132f.jpg

 

I tried, but first row created the right file, but second row gets me :

ERROR: failed to set compression for /mnt/ssd/swap/swapfile: Invalid argument

 

And while the filehas been created after a few seconds, the options doesn't update to the right size on the pluggin.

 

And regarding swapiness, should I run this ?

 

sysctl /mnt/ssd/swap/swapfile.swappiness=10

 

Thanks !

 

Note that I'm doing this for GitLab CE repository that wants to eat all my ram.

I probably could find the answers by googling, but I'm hopping some user may find this post useful.

Edited by dboris
Link to comment
7 hours ago, dboris said:

So it really was out of luck that 10000 worked and 10001 failed !

 

 

I searched and found on this topic some indications to use the terminal :

 

 

dd if=/dev/zero of=/mnt/ssd/swap/swapfile bs=1M count=32768
btrfs property set /mnt/ssd/swap/swapfile compression none
mkswap -L swapfile /mnt/cache/ssd/swapfile
chmod 600 /mnt/ssd/swap/swapfile
swapon -v /mnt/ssd/swap/swapfile

 

Would you mind validating that this matches the settings bellow ? :)

765377615_Screenshot2024-02-21at09_10_10.thumb.jpg.3c8541d4ff75b0b90973d117add7132f.jpg

 

I tried, but first row created the right file, but second row gets me :

ERROR: failed to set compression for /mnt/ssd/swap/swapfile: Invalid argument

 

And while the filehas been created after a few seconds, the options doesn't update to the right size on the pluggin.

 

And regarding swapiness, should I run this ?

 

sysctl /mnt/ssd/swap/swapfile.swappiness=10

 

Thanks !

 

Note that I'm doing this for GitLab CE repository that wants to eat all my ram.

I probably could find the answers by googling, but I'm hopping some user may find this post useful.

Did you create the folder called "swap"? If so delete it and and recreate it with the command "btrfs sub create /mnt/ssd/swap". Swapfiles need to be in a subvolume on btrfs. The plugin should create it automatically if it is allowed to create the folder as well as the swapfile.

  • Like 1
Link to comment
  • 1 month later...

Since the last 2 minor unraid updates it seems that mkswap can't grab the created swapfile anymore (on xfs), resulting in a massive CPU load (50 to over 100 load on a 16 thread CPU) ending in the system being unresponsive.

Edited by BIGFAT
Link to comment
2 hours ago, BIGFAT said:

Since the last 2 minor unraid updates it seems that mkswap can't grab the created swapfile anymore (on xfs), resulting in a massive CPU load (50 to over 100 load on a 16 thread CPU) ending in the system being unresponsive.

Logs (specifically anything that mentions swapfile) and the specifics of your settings would be helpful. Also the actual unRAID Version as i am not certain what the last 2 minor releases were. 
 

Link to comment
On 3/29/2024 at 7:44 PM, primeval_god said:

Logs (specifically anything that mentions swapfile) and the specifics of your settings would be helpful. Also the actual unRAID Version as i am not certain what the last 2 minor releases were. 
 

Will try again once parity is fully sync again in about 24 hours since i couldn't really check for logs and didn't save them otherwise before crashing. Had to hard reset the system yesterday after it got unresponsive and didn't do the regular shutdown over the case shutdown button. What i stated was only what i could perceive in the "surviving" unresponsive ssh htop shell. After uninstalling the plugin system is stable again. But since some workload i use likes a lot of ram i still need this plugin on the long run :).

 

PS: Nothing special in the logs, for now it seems to work again without any issues.

Edited by BIGFAT
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.