Jump to content

Overprovisioning RAM on a VM?


Recommended Posts

I understand that unRAID does not natively support overprovisioning RAM on VM's like Proxmox or VMWare do. With this i mean that if i allocate 24GB RAM to a VM, this 24GB will be in use at all times and absolutely cannot be used by another process.

 

Is there any way at all how i can make unRAID support this? I am not entirely sure how deep in the OS this needs to be done and of course i understand if it's completely impossible, but even if there is a slight chance that i can use this through some sketchy workaround, i'm willing to try this.

 

I want to run a service on my unRAID server that does not have good native Docker support but does have great Linux support, so i would like to put it in a VM. It will need a lot of RAM but when this RAM is not used, i would prefer it to be able to be used by other services on my server. Any way at all to achieve this on unRAID?

 

I did try googling for this but it's kinda hard to find information about it.

Link to comment
23 hours ago, Squid said:

Unraid does support minimum RAM and maximum RAM allocated to the VM's when editing the template.  Not really sure if anyone has ever played with this, or what requirements are necessary on the VM side of things.

Right, i just quickly tried it out on an Ubuntu VM. I put minimum on 2GB and maximum on 16GB. On the "VMS" page the VM still said "16384M" on memory but then as soon as i start the VM up it goes to "2048M" and Ubuntu only reports having 2GB RAM available as well. Is this expected behavior?

Edited by YourNightmar3
Link to comment

It is possible but unraid only seems to run the memory sharing feature when 80% of your ram is used and seems to stop bothering to do anymore when ram drops below that, until it reaches 80% again. It checks every 10 minutes from what I can see. Not sure how to change these settings.

 

What you can do as a test is when the system is up

echo 1 > /sys/kernel/mm/ksm/run

 

This turns on the feature, and you can check how many scans it has done with

cat /sys/kernel/mm/ksm/full_scans

 

The number should increase from 1 onwards each time it scans. It only scans when it determines it needs to (>80%) as mentioned.

 

The amount of memory saved is:

cat /sys/kernel/mm/ksm/pages_sharing

 

In my example this value is 484008 but each page is 4096 bytes so to convert it to megabytes you must

484008*4096/1024/1024 = 1890Mb saved.

 

It doesnt work very well, and Im not sure how to tweak the settings to make it more efficient but its "in there" in some form. It saves some memory but not a whole lot.

 

Also to enable this feature in the VM, you must remove the <nosharepages/> line from the XML or it is not considered as a VM that can be used when the scan is run.

 

Pete

 

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.

×
×
  • Create New...