Jump to content

Pining CPUS to docker and isolation


Recommended Posts

Hi,

After watching many of the excellent videos by SpaceInvader One, I decided to isoloate some cpus from UNRAID and the pin them to one VM and my Plex docker.

However since doing this I have this error message from the "fix common problems" plugin,

 

ERRORS FOUND SUGGESTED FIX  
Docker Application plex has multiple CPUs pinned to isolated CPUs Unless you know exactly what you are doing, pinning a docker application to multiple isolated CPUs will only allow the application to execute on a single isolated core  and adjust either the Isolated CPUs or the application's CPU pinning

 

I upgraded to Version 6.6.0 the other day without issue.

Here's the line I added,

isolcpus=4-15,20-31

and wanted to pin 4 or 6 cores to Plex.

 

https://youtu.be/p0iPpPyebUw?t=517

 

Any advice please?

 

 

Link to comment

After reading what I wrote I would like to clarify, 

Quote

Unless you know exactly what you are doing, pinning a docker application to multiple isolated CPUs will only allow the application to execute on a single isolated core

If I understand correctly, I could pin Plex to 4 cores but it will only ever use one? 

Is that correct?

Link to comment
14 hours ago, Squid said:

If you isolate cores via the cpu pinning page, and then tell Plex to execute on more than one of those cores via cpu pinning, it will only execute on one of them.

Isolating cores is usually used to reserve the core for exclusive use of a VM.
 

Thanks for the reply, I guess it was this part of the video I must have misunderstood.

image.thumb.png.4396ac9c04affe5603c0e928cdc08136.png

 

My question now is, is there any way at all to pin multiple cpu cores exclusively for docker applications?

Thanks

 

Link to comment
6 minutes ago, Squid said:

If you want a VM to have exclusive access to the cores then you isolate those cores and pin the VM to them

I think I misunderstood the concept as well. Thought isolating cpu meant that unraid only would use said cores. 

 

So unraid and containers will always use all cores, unless I pin a specific container to specific numbers of cpu cores?

 

Just to be clear, this screenshot does not mean that unraid only will use 4 cores then?

image.png.a57513203ae617d19b7c01027171f4ca.png

Edited by ZataH
Link to comment
  • 2 months later...

I also went in this trap.

 

Quote

CPU isolation allows the user to specify CPU cores that are to be explicitly reserved for assignment (to VMs or Docker containers).

Settings/CPUset - CPU Isolation

 

So I isolated half of the cores (6-11 + 18-23). I've since been troubles with Plex just grinding to a halt, and had actually decided to look into that today. Seems like I no longer have to. Running two 4K transcodes at the same time I could see it 100% the four cores it still had access to (it was pinned to 4-9 + 16-21), while it should have utilized up to 8 more cores. I'm assuming this will solve my issues.

 

Screenshot_649.JPG.e9e317353e997cc86ceeb5056f98504e.JPG

Screenshot_650.JPG.8fdc3e61f874db2384b080165e0ae15b.JPG

 

If isolation isn't supposed to let you assign cores to Docker I really think the help text should be updated.

Edited by JimL
Link to comment
  • 2 weeks later...

There definitely seems to be an issue with CPU isolation and Dockers.. Did a bunch of testing with Plex, Nzbget, Sonarr, Radarr etc and it seems when you isolate multiple cores, for example I Isolated cores 5/11 which is my pair I assigned those isolated CPUs to nzbget, sonarr,radarr and you can only see core 5 being utilized, not 11.. It doesn't make much sense. As soon as I disable isolation on lets say core 11, I can then see usage on that core from those dockers.. At this point I've completely turned off CPU isolation and it seems all my CPU pinning is working properly but id like to isolate certain cores so the OS doesn't utilize them at all, just certain dockers.. Not sure if this is a bug or a misunderstanding on how it's supposed to work.

Link to comment
10 minutes ago, Trembler said:

I Isolated cores 5/11 which is my pair I assigned those isolated CPUs to nzbget, sonarr,radarr and you can only see core 5 being utilized, not 11..

Isolating cores means that you're isolating them from the base OS (unRaid).  Net result is that the task switcher won't touch those cores.  Which means that if you pin an application to multiple isolated cores, it will only run on the lowest numbered one.  

 

IE: Don't isolate cores 5/11 if you want your apps to run on them.

 

Isolating cores is generally only done to give a VM exclusive rights to the cores.

Edited by Squid
Link to comment
On 1/4/2019 at 7:48 PM, Squid said:

To be honest,  I argued for when a core is isolated to not allow the GUI to let you select it for a container, as I knew that this question was going to happen over and over again. (which it has). 

It would at least help if the text was changed to this

 

Quote

CPU isolation allows the user to specify CPU cores that are to be explicitly reserved for assignment to VMs.

 

Instead of what it currently is, which explicitely states you can use isolated cores for docker containers
 

Quote

 

CPU isolation allows the user to specify CPU cores that are to be explicitly reserved for assignment (to VMs or Docker containers). 

Settings/CPUset - CPU Isolation

 

 

But yes I would agree, disabling the cores where they are not usable, preferably with a tooltip saying the core is isolated would be very nice.

Edited by JimL
Link to comment
42 minutes ago, JimL said:

CPU isolation allows the user to specify CPU cores that are to be explicitly reserved for assignment (to VMs or Docker containers). 

 

Probably the argument would be that the statement as above is actually correct.  Nothing says that you can't isolate a core and then have a container(s) run on it.  The problem lies when multiple cores are isolated and the container is then pinned to those multiple cores.  (as an aside, the Fix Common Problems plugin does catch this error)

 

 

Link to comment

I might be slow but I still find it extremely confusing. Like, I understand (from your posts, not the web ui) that if I select the cores to be isolated then I am stuck with assigning ONE core to each "thing". But does that mean VMs can also only run on one (isolated) core? Seems like a use case that at least I find to be very edge case / never used.

Edited by JimL
Link to comment
On 1/4/2019 at 9:55 AM, Squid said:

Isolating cores means that you're isolating them from the base OS (unRaid).  Net result is that the task switcher won't touch those cores.  Which means that if you pin an application to multiple isolated cores, it will only run on the lowest numbered one.  

 

IE: Don't isolate cores 5/11 if you want your apps to run on them.

 

Isolating cores is generally only done to give a VM exclusive rights to the cores.

Thank you, makes total sense! It's confusing. I like the thought of not being able to select isolated cores in the containers. So basically if i isolate cores i can use them just for the VM and nothing else will touch them? 

Edited by Trembler
Link to comment
  • 7 months later...

I resurrect this post as it is not clear for me:

I have a 8 cores CPU and I isolated 4 cores so unraid does not use them.

If I don't pin any docker, will they use the 4 cores + the 4 isolated cores that unraid is unable to use or will they be restricted to the same cores as unraid?

Thanks 

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...