Changing worker_process to auto in nginx configuration letting nginx to use all available CPUs of node.
In case of pods where we are limiting nginx to use only 2 CPU, it is expected that setting worker_process will use only 2 CPU but instead of that it is using all available node CPU. Is this expected behaviour in case of pods?
When resource limits are defined, Kubernetes makes sure to provide only that limited quota of CPU and memory for the container.
A container cannot use more than its share of CPU time during this interval.
So, even if the container tries to use more; it will be restricted.
i think you can setup a nginx.conf from configmap, and set worker_process from there.