Jump to content
theone

Swap File Plugin for unRAID v5 and v6

86 posts in this topic Last Reply

Recommended Posts

2 hours ago, Spies said:

Just changed it to /mnt/disk4/cache and now it shows:

This means you have accidentally created a user share named "cache". Any top level folder from cache or array disks is automatically a user share named for the folder with default settings.

 

If you have the Fix Common Problems plugin installed it will give you a warning about this.

 

This is not generally a good idea because you will see it over the network and think it is referring to the cache disk when really it is a user share that happens to be named "cache".

Share this post


Link to post

Don't use this plugin with 6.4.0-RC2 or higher it causes emhttpd to error out and crash.

Share this post


Link to post
10 hours ago, Tilton53 said:

Don't use this plugin with 6.4.0-RC2 or higher it causes emhttpd to error out and crash.

I just installed it to test this, and I don't know what you're seeing.  Can you elaborate?

Share this post


Link to post

Well it seems like the plugin doesn't work with 6.4.0-rc8q anymore?

The UI is responsive, the swap file is created, but I can't manage to get it used... :/

Share this post


Link to post

Anybody running this on 6.5.3?  My memory usage is creeping up and upgrading isn't a financially viable option given the insane RAM prices, so interested in giving this a try.

Share this post


Link to post

Ok, I've been using this for a few days - can I use a few questions please.

 

I've created a 32GB swapfile as I've added an extra unassigned SSD that has spare space.  It's been live for around 1.5 days and it's using 8GB so far, but I've got free memory.  When does it move data to the swap?  I thought it only did it when the physical ram was getting low?  What controls it?  If the swap data is accessed, is it moved back to ram?

 

Thanks

Share this post


Link to post
On 6/24/2018 at 9:20 AM, DZMM said:

Ok, I've been using this for a few days - can I use a few questions please.

 

I've created a 32GB swapfile as I've added an extra unassigned SSD that has spare space.  It's been live for around 1.5 days and it's using 8GB so far, but I've got free memory.  When does it move data to the swap?  I thought it only did it when the physical ram was getting low?  What controls it?  If the swap data is accessed, is it moved back to ram?

 

Thanks

 

It is controlled by swappiness. I guess you could create a userscript on startup that sets the swappiness. https://askubuntu.com/questions/103915/how-do-i-configure-swappiness

 

I suggest the plugin author adds an option for this in the plugin. 

sysctl vm.swappiness=[value]
Edited by maciekish
  • Like 1

Share this post


Link to post
42 minutes ago, maciekish said:

 

It is controlled by swappiness. I guess you could create a userscript on startup that sets the swappiness. https://askubuntu.com/questions/103915/how-do-i-configure-swappiness

 

I suggest the plugin author adds an option for this in the plugin. 


sysctl vm.swappiness=[value]

Thanks I've set mine to 10 so it kicks in when 90% of memory used - I've got 64GB so this means it's there for insurance.  Default is 60, which is too 'aggressive' for my use case.

Share this post


Link to post

Out of interest, does all memory get moved to SWAP e.g. even memory in use by VMs? 

 

Is there a way to not swap VM memory, or only certain dockers where performance doesn't matter?

Share this post


Link to post

When trying to create a 8 GB swap file it stuck on 6.4 GB so I manually made one with fallocate and mkswap. I don't really understand why the plugin doesn't use that method...

On 11/20/2018 at 7:44 PM, DZMM said:

Out of interest, does all memory get moved to SWAP e.g. even memory in use by VMs? 

 

Is there a way to not swap VM memory, or only certain dockers where performance doesn't matter?

You shouldn't really notice much of a performance hit. And afaik it's not possible on linux and I think it's really difficult to implement exclusions.

Memory is assigned in pages. Most of the time blocks of 4 KB (or 2 MB or 1GB). The linux kernel handles swapping and it tries to swap out pages which are least recently used.  For example when a program starts it may load a lot of code in memory just for initialization but after that it won't be used so this code which is allocated in pages can be swapped out to free up memory. So yes, all memory is swapped out. (If I'm correct, it may be that Linux handles it differently, I'm only a CS student not an expert ;) ).

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now