jonp Posted November 13, 2014 Share Posted November 13, 2014 UPDATE 4/27/2015: --cpuset will be deprecated in Docker 1.6. For those using unRAID 6 beta 15, you are not affected, but when we upgrade to Docker 1.6, this will be impacted. The new method will be to use --cpuset-cpus (it's just being renamed). Hey guys, wanted to share something cool we figured out today that can substantially impact how Docker and VMs work together on the same host. In short, you can force individual containers to be bound to specific CPU cores inside unRAID. Why is this useful? The number one thing that can affect user experience for VMs running on an unRAID host that are localized is context switching. When applications are competing for access to the CPU, they essentially take turns and when that happens, the processor performs a context switch where it unloads data from within the processors L1, L2, and L3 cache back into RAM temporarily so that the other process can load into that cache quickly to perform it's job, then unload and reload the first process. While this is a normal thing to occur, it can cause some undesirable effects when severely processor intensive activities are happening in both a container and a VM at the same time. By pinning specific containers to specific cores, similar to how we can with virtual machines, we can completely eliminate the need for context switching to occur and as a result, avoid undesirable impacts to user experience. How to do it The plan is to implement this into dockerMan in an upcoming release as an advanced configuration option that you can choose to apply to all docker containers or individual containers, but for now, you can take advantage of this TODAY by modifying your existing containers in dockerMan like so: In the "repository name" field, simply add the following code before the name of the author/repo: --cpuset=# If you want to set multiple cores, you can do so by using commas or to specify a range of cores, you can use a dash. Examples: --cpuset=0,2,4,6 --cpuset=0-3 Note that cores are numbered starting with 0. Also note that you can check the # of cores you have in total on your system by typing the following in a command line session (SSH or Telnet): nproc 1 Quote 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.