Get Fancy with Docker and CPU Pinning


jonp

Recommended Posts

When I first tested BOINC docker, I didn't throttle it at all. It appeared to have no impact on anything else that way so I just left it. Parity checks run as fast as ever. NZBGet happens in the middle of the night anyway and works fine but I've never bothered to check performance. I typically have only one plex stream without transcoding, maybe that would be an issue for other usage, I don't know.

Link to comment

For BOINC, I don't use cpuset-cpu's because it already manages the max cpu correctly.

 

In BOINC menu (regular view), I go to "computing preferences" and set it to "use no more than 50% of the processor".

Then when I go to unraid dashboard I see that my cpu is pegged at 50%.

 

The advanced view BOINC menu computing preferences has another option for multiprocessor cpu usage but I don't use that. I believe docker has its own cpu management system and spreads the use to different cores. For instance in sabnzbd, the software is only supposed to use one processor core (with my settings), but when run in docker, it maxes out all cpu cores so I have to use cpuset-cpu's to limit it from taking over the whole system during unraring.

 

BOINC on the other hand can limit "total cpu usage" so I never had the issue of BOINC hogging all system resources

 

Is that not the case for you?

Link to comment

Trurl -  are you actually subscribed to a project?  My issue starts after I add my first project

 

Squid - I will try this. However, I suspect it is accurate because when the cpu spike happens, I lose connection to the boinc rdp session

Been running 2 projects for months with all default settings and no issues. unRAID GUI reports 100% CPU for me also but it doesn't seem to be a problem for anything else I use the server for.
Link to comment

here are screenshots of Htop.

 

Trurl - So you see in the GUI the same as I do.  However, when mine happens, I can barely navigate through unraid menus, and like i said before, BOINC RDP disconnects.

 

aptalca - I have tried the 50% setting.  It seems to make no difference.  Can you post a screenshot of your settings?

withboinc.jpg.d23ca93db94cbceda526393509f0e780.jpg

Link to comment

here are screenshots of Htop.

 

Trurl - So you see in the GUI the same as I do.  However, when mine happens, I can barely navigate through unraid menus, and like i said before, BOINC RDP disconnects.

 

aptalca - I have tried the 50% setting.  It seems to make no difference.  Can you post a screenshot of your settings?

 

Try a larger telnet window, it's very hard to read.

 

Attached are screenshots showing my htop with max cpu set to 30% and BOINC settings

 

Capture6.JPG.07b293b2e1678ac0e7f7265c7163547a.JPG

Capture7.JPG.695a66ecdde671e683fcaf0feef5f45d.JPG

Link to comment

So I may have uncovered the source of the issue.  I have a windows 7 VM running.  If I shut it down, and set boinc to 50% CPU, all works fine.  Now, its worth mentioning that the unraid dashboard bounces all over the place, but HTOP shows a nice even 50%.  However, as soon as I fire up my VM, CPU goes crazy again and BOINC crashes like before.  Traditionally, the VM does not use much, if any CPU, and its all on Core 0.  But, it does use memory, and boinc seems to use alot as well.  Could this be a result of my machine running out of RAM?  I have 4GB only, and the VM allocates 2GB

Link to comment

So I may have uncovered the source of the issue.  I have a windows 7 VM running.  If I shut it down, and set boinc to 50% CPU, all works fine.  Now, its worth mentioning that the unraid dashboard bounces all over the place, but HTOP shows a nice even 50%.  However, as soon as I fire up my VM, CPU goes crazy again and BOINC crashes like before.  Traditionally, the VM does not use much, if any CPU, and its all on Core 0.  But, it does use memory, and boinc seems to use alot as well.  Could this be a result of my machine running out of RAM?  I have 4GB only, and the VM allocates 2GB

Don't know the answer but for comparison, I am not running any VMs and I have 16GB RAM.
Link to comment

I have been running into problems like this with my Emby plugin. I have 4 cores and 16 gig of ram. I have emby using 3 of the 4 cores. When transcoding a tv show from a remote location during parts of the process i get to 75% cpu, which is expected. If I try a movie, most of the time my cpu jumps to 100% and if I don't kill it in time, it will crash my entire server. My Ram never gets close to 100%. This only started happening after we were warned about the cpuset code change. I have tripled check to make sure I changed it and it looks right ( I can't check right now) and like I said, it normally just uses up to 3 cores. I haven't gotten the chance to test it since upgrading to rc1.

 

Link to comment
  • 1 month later...

Using 6.1.2, applying --cpuset-cpus=4,5 to one of my dockers and while it looks like yes, it is working... There is a side effect.  I cannot hit the view webgui anymore from the docker page.  That option is simply gone now... 

 

Can anyone confirm this / know what it is doing? Here's an example:

 

--cpuset-cpus=4,5 pducharme/unifi-video-controller

 

however it happens on any container I put a --cpuset-cpus= on.

Link to comment

Using 6.1.2, applying --cpuset-cpus=4,5 to one of my dockers and while it looks like yes, it is working... There is a side effect.  I cannot hit the view webgui anymore from the docker page.  That option is simply gone now... 

 

Can anyone confirm this / know what it is doing? Here's an example:

 

--cpuset-cpus=4,5 pducharme/unifi-video-controller

 

however it happens on any container I put a --cpuset-cpus= on.

Works fine for me on folding@home
Link to comment

Using 6.1.2, applying --cpuset-cpus=4,5 to one of my dockers and while it looks like yes, it is working... There is a side effect.  I cannot hit the view webgui anymore from the docker page.  That option is simply gone now... 

 

Can anyone confirm this / know what it is doing? Here's an example:

 

--cpuset-cpus=4,5 pducharme/unifi-video-controller

 

however it happens on any container I put a --cpuset-cpus= on.

So you mean that when you click the app icon, the option called WebUI is gone?  That is odd.  Edit the container again and open advance view. Under additional fields, what does the webui option show?

Link to comment

So you mean that when you click the app icon, the option called WebUI is gone?  That is odd.  Edit the container again and open advance view. Under additional fields, what does the webui option show?

 

http://[iP]:[PORT:8080]/

 

.. tried it on the Sabnzb, plex, unifi-video ones... all of them do the same thing.

 

Side note, soon as I remove the cpu flag, it comes right back...  so weird

 

I went ahead and put something besides the default in there and still don't see an option for webui.. https://192.168.2.51:9080  is what I put in for Sab .. 

 

 

 

Link to comment

Ok, where are you putting the cpuset-cpus parameter?  If you are putting it after the repository name, that may be the problem.  You should be using the extra parameters field for this. Let me know.

 

That was it, I was putting it on the repository field as it shows on the first post...  guess the location changed at some point where it needed to be. 

 

Moved it to extra parameters and the webgui is back, thanks!

Link to comment

Ok, where are you putting the cpuset-cpus parameter?  If you are putting it after the repository name, that may be the problem.  You should be using the extra parameters field for this. Let me know.

 

That was it, I was putting it on the repository field as it shows on the first post...  guess the location changed at some point where it needed to be. 

 

Moved it to extra parameters and the webgui is back, thanks!

Guess I need to update the guide here. Thanks for reporting and your patience while we sorted it out.

Link to comment
  • 3 months later...

i'm not sure this is still working... I swear it was working fine back on 6.1.1 but on 6.1.4 and now 6.1.6, on an app like Sabnzbd which I have limited to "--cpuset-cpus=0,1" I'll see it spiking all 4 cores on my i7 (as well as the hyperthreaded cores) and I'll even have issues where in sab it'll show loads upwards of 20 and it'll impact another docker that is assigned 2-5  to the point the other docker loses connections with the cameras (camera server)

 

Is there some better way to tell if it really is still working like it should?

Link to comment
  • 2 weeks later...
  • 2 weeks later...

Having done this seems to have fixed all my WebUI hanging.  I dedicated most dockers to sharing variations of the last 4 cores (of an 8 core), but gave Plex free reign of 1-7, then left 0 untouched so unRAID should have all of it.  Pushing 62 days of up time after doing this.  Before I was hanging 1-2 times a week and would have to force a restart. 

Link to comment
  • 3 weeks later...

Any chance of this feature being added to the DockerMan GUI similar the VM Manager?

 

A list of CPU core checkboxes in the advanced mode would make managing CPU pinning much easier for those who want it.

 

+1 for CPU core checkboxes!

 

+1 ,, I think my crashplan performance could be enhanced significantly here... Its cpu intensive stuff is really slow with my cpu still allmost sleeping,, could this be the context switching ?

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.