Phrendo Posted December 10, 2021 Share Posted December 10, 2021 Hello All, My question is really about what the docker is allowed to utilize as far as CPU cores are concerned. I have a running SQL Server in a container. I am currently running a fairly intensive process within SQL. I would expect the CPU of the container to be near 100%. My problem is that it appears to only be using one core of the host at a time. I have edited the CPU pinning within the Docker Config (tried All On, All On except 0,1), but get the same result. To be clear, I want to allocate as much CPU to my SQL Server as possible. The version of SQL server that I am using within the container does allow multi-core usage. Any help would be very much appreciated! Quote Link to comment
Squid Posted December 11, 2021 Share Posted December 11, 2021 20 hours ago, Phrendo said: I have edited the CPU pinning within the Docker Config (tried All On, All On except 0,1), but get the same result. To be clear, I want to allocate as much CPU to my SQL Server as possible. The version of SQL server that I am using within the container does allow multi-core usage. Are you running VM's? Have you isolated cores to the VM's? Best way to give as much CPU to any given container is not not pin it to anything at all. Now, if you've isolated CPU cores for VMs, then the containers will only run on the non-isolated cores, and if you try and pin a container to multiple isolated cores then it will only ever run on the lowest numbered one. Quote Link to comment
Phrendo Posted December 11, 2021 Author Share Posted December 11, 2021 Thanks for the response @Squid. Regarding the CPU Pinning, I tried every variation, all while have the VM service turned off. I did figure it out though. The SQL procedure that I was testing with was forcing a single thread. Right now, I have the Docker pinned to the 6 cores (no HT) and I am running 6 instances of the SQL procedure. As you can see in the image below, it is in fact properly using the pinned CPUs (always was). It is odd that the docker stats command reports a sum of all cores on the CPU % though (this is what was throwing me off earlier). Again, thank you for the response. Quote Link to comment
Squid Posted December 11, 2021 Share Posted December 11, 2021 That % is actually quite normal. By default (and convention in Linux), the percentages reported by each core are added up. (Note that on the docker page itself (Advanced view), those percentages are normalized to be 0-100, so that page would be showing you 50% - although I can't remember if it takes into consideration the pinned cores or not so it might show 100%) Quote Link to comment
Recommended Posts
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.