August 1, 20232 yr Author 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 August 1, 20232 yr by primeval_god
August 1, 20232 yr Author 6 hours ago, Zeench said: 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: Edited August 1, 20232 yr by primeval_god
August 2, 20232 yr 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. Edited August 2, 20232 yr by Zeench
August 5, 20232 yr Is there a reason the swap file would fill up if I still had heaps of ram free? Today I had about 30 gigs RAM free and the swap file was sitting at around 7 gig (91%)
August 5, 20232 yr Author 4 hours ago, DrSpaldo said: Is there a reason the swap file would fill up if I still had heaps of ram free? Today I had about 30 gigs RAM free and the swap file was sitting at around 7 gig (91%) What setting do you have for swappiness? Lower values will swap data out less aggressively.
August 6, 20232 yr 8 hours ago, primeval_god said: What setting do you have for swappiness? Lower values will swap data out less aggressively. Hi, I just left it at the default (60)
October 1, 20232 yr 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!
October 1, 20232 yr Author 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! what file system is your cache drive
October 2, 20232 yr Author 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.
October 5, 20232 yr 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!
January 23, 20242 yr 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 ! 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 ... I chose /mnt/disk4 as a location (xfs) because i have 2 cache drives and read it would not work. Also, Is there a reason why text is overlapping? Thanks Edited January 24, 20242 yr by theosusan
January 25, 20242 yr Author 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).
January 28, 20242 yr Hi I uninstalled this plugin, but I still see kswapd0 and kcompactd0 using CPU. I have asked on unraid discord and it seems it's not usually running at all for other unraid users. Anyway to remove kswap entirely?
February 21, 20242 yr When typing "10G" or swap amounts above 10000, I noticed the pluggin stops working : Cache is missing when typing "free -m".
February 21, 20242 yr Author 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.
February 21, 20242 yr 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 ? 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 February 21, 20242 yr by dboris
February 21, 20242 yr Author 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 ? 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.
March 29, 20242 yr 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 March 29, 20242 yr by BIGFAT
March 29, 20242 yr Author 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.
March 29, 20242 yr 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 April 8, 20242 yr by BIGFAT
September 25, 20241 yr I've encountered a issue. The swap file location was configured to: `/mnt/disks/ssd1`, but automount for the disk was not enabled, so the filesystem was not mounted. The script will try to create the swap file in `/mnt/`filesystem, where is not enough disk space. The script `/usr/local/emhttp/plugins/swapfile/scripts/rc.swapfile` has no error check for `dd` command creating the swap file and thus did not detect any error: # Create swap file logit "Creating swap file ${SWAP_LOCATION}/${SWAP_FILENAME} please wait ..." dd if=/dev/zero of=${SWAP_LOCATION_NEW}/${SWAP_FILENAME_NEW} bs=1M count=${SWAP_SIZE_MB_NEW} Maybe we should check if target filesystem has enough free space before creating the swap file to avoid this issue? At least the script should check if `dd` command was successfull and or should check if swap file does have the desired size? Edited September 25, 20241 yr by pixeldoc81 Reformatting
September 26, 20241 yr Author 13 hours ago, pixeldoc81 said: The swap file location was configured to: `/mnt/disks/ssd1`, but automount for the disk was not enabled, so the filesystem was not mounted. I am guessing that ssd1 is a disk mounted with unassigned devices? The plugin wasnt really designed with those in mind. A permanent single disk pool is really more suited to hosting a swapfile.
September 30, 20241 yr On 9/26/2024 at 2:32 AM, primeval_god said: I am guessing that ssd1 is a disk mounted with unassigned devices? The plugin wasnt really designed with those in mind. A permanent single disk pool is really more suited to hosting a swapfile. You are right, this is a single disk mounted with unassigned devices plugin. Using a single disk pool did not cross my mind. I will give it a try. IMHO better error handling would be great. Is the swapfile plugin source on github to maybe contribute a pr?
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.