
Description
We want to use limited license on docker.
But, there is no option to add affinity as a start up parameter.
We all know, SQL affinity or soft numa can adjust after start up.
However, we need restart SQL server in many cases to settle.
Docker nature, once PID=1 is down, Pods destroyed.
So, if SQL server has option to adjust affinity mask or soft numa as a startup parameter, it would be easier to setup with proper licensing cost.
The other problem of Express edition, by default, it run on Socket 0 processor.
Depends core count of socket, it could be CPU0 upto CPU3.
And, it only shows "NumaNode0"- CPU0 to CPU3 only.
There is no option to move NumaNode1 even if we can restart it.
The issue is, it always spin up CPU0. So that, it is very hard to make an orchestration.
In the Kubernetes environment, container can see all host CPU.
But, by default, express edition only spin up from CPU0 - CPU3 only.
As a Kubernetes nature, this is a big issue if we run 2-3 SQL pods runs on same worker node, it only spin up first 4 CPU.
And, there is no option to change affinity on K8s.
Somehow, if we can add affinity, that is not resolve all issues.
SQL server supported to pick smart enough lower CPUs only based on total licensed processors.
Otherwise, no one will move to Docker containers.
i.e
Let say we have 1 Kubernetes worker nodes with 32 core each.
As a starting point on container, we move on only some small read only databases which is only required 4 cores with 6 replica.
It will compete each other to get cpu 0-4 only if it runs same worker nodes.
These days, no one want to assign affinity. Most likely it is not required.
Conclusion, please provide start up option for SQL server with licensed core count.
Plus, SQL server could pick up cpu core(s) randomly or smart enough to pick low utilize one up to licensed core count.
Here is my suggestion
i.e. /opt/mssql/bin/sqlservr --corecount=4 --affinity=[random(default), auto, 4 to 7 or, 1, 3, 5, 7 ]