VM Priority and Docker CPU Selection


Recommended Posts

Limit Docker images to use Specific CPU Cores (Threads)

 

I run PLEX on my i7 but I also use the machine with a Windows 10 Gaming Machine installed using 3 of the cores for the VM but I'd like to set a dynamic usage for PLEX when gaming machine is running then reduce running cores on PLEX or set a lower CPU priority to the docker containers over a VM image.

 

Link to comment

You could probably do it through setting the "nice" level of the plex process manually via the cmd line but AFAIK there is no way to do this through the GUI (but you can set plex to always have priority over other apps)

 

Sent from my LG-D852 using Tapatalk

 

 

Link to comment

Might not have made myself clear. I want my Windows10 machine while I'm gaming to have dedicated CPU cores so that I don't drop frames and actually enjoy my gaming experience.

 

When the VM is off, then allow PLEX to use the full range of cores available to it.

 

VM ON:

Docker PLEX 3 Cores + HT

Windows 10 VM 3 Cores + HT

VM OFF:

Docker PLEX 6 Cores + HT

Windows 10 VM 0 Cores OFF

Link to comment

Might not have made myself clear. I want my Windows10 machine while I'm gaming to have dedicated CPU cores so that I don't drop frames and actually enjoy my gaming experience.

 

When the VM is off, then allow PLEX to use the full range of cores available to it.

 

VM ON:

Docker PLEX 3 Cores + HT

Windows 10 VM 3 Cores + HT

VM OFF:

Docker PLEX 6 Cores + HT

Windows 10 VM 0 Cores OFF

 

As far as I know, docker cpu pinning is set during container creation and changes to it require a container reinstall. So dynamically changing would involve constant reinstalls of the container and would produce significant overhead (especially for containers that by default install an older version of the app and then update upon first start).

 

For the VMs, you can isolate cpus so they are not used by unraid (or docker) and are reserved for VMs. But again, setting it requires a kernel parameter (in syslinux) and requires a reboot for changes. Not suitable for dynamic changes.

Link to comment

For the VMs, you can isolate cpus so they are not used by unraid (or docker) and are reserved for VMs. But again, setting it requires a kernel parameter (in syslinux) and requires a reboot for changes. Not suitable for dynamic changes.

 

Aptalca this does interest me, I'm guessing you are saying this can't be done via the GUI? I have always wondered as my Windows VM is set to use Core 0 on my 4x core processor. If the VM is running does it get 100% use of that core? Or can Plex for example steal some of that cores resources if it is performing transcoding for example?

 

It's not a major issue as I just use the VM as a bit of a safe test and browsing environment but I have noticed when using it sometimes the performance drops off significantly.

Link to comment

Why not stop the docker when you are using the vm?

 

I dont know if this would be possible but dont see why not.

1. Install a plex docker that has usuage of all your cores.

2. Then install the same plex docker(but naming it plex2 or something) but pointing it to the same appdata set for plex as the first. However on this plex docker pin it to only 1 core using --cpuset-cpus in the extras parameters see http://lime-technology.com/forum/index.php?topic=36257.0

 

Obviously dont run both dockers together but when you are using your gaming vm stop the multicore plex docker and start the single core docker.

Then when you are not using the vm stop the single core docker and restart the multi core docker. I am sure this should work as both dockers would be using the same appdata.

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.