You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NGINX gets the number of CPU cores via getconf _NPROCESSORS_ONLN, which in turn reads from /sys/devices/system/cpu/online. In a containerization environment, this is mounted directly from the host, and the cgroups doesn't have any effect on this value. As such, setting .nginx.enableCPUAffinity to true (worker_cpu_affinity auto; in NGINX config) by default will affect the behavior of APISIX, for instance, the performance degrades significantly when running multiple APISIX containers on the same host, as they (NGINX worker processes) are bound to the same CPU cores.
Additional note, due to the same reason, defaulting .nginx.workerProcesses to auto (worker_processes auto; in NGINX config) will also impact the performance, for example, when .apisix.resources.limits.cpu is configured.
A possible workaround is to set .nginx.enableCPUAffinity to false when installing APISIX as a deployment kind (which is the default), and set .nginx.workerProcesses to the same number of CPU cores specified in .apisix.resources.limits.cpu.
The text was updated successfully, but these errors were encountered:
Following the merged change at apache/apisix#8074.
NGINX gets the number of CPU cores via
getconf _NPROCESSORS_ONLN
, which in turn reads from/sys/devices/system/cpu/online
. In a containerization environment, this is mounted directly from the host, and the cgroups doesn't have any effect on this value. As such, setting.nginx.enableCPUAffinity
totrue
(worker_cpu_affinity auto;
in NGINX config) by default will affect the behavior of APISIX, for instance, the performance degrades significantly when running multiple APISIX containers on the same host, as they (NGINX worker processes) are bound to the same CPU cores.Additional note, due to the same reason, defaulting
.nginx.workerProcesses
toauto
(worker_processes auto;
in NGINX config) will also impact the performance, for example, when.apisix.resources.limits.cpu
is configured.A possible workaround is to set
.nginx.enableCPUAffinity
tofalse
when installing APISIX as a deployment kind (which is the default), and set.nginx.workerProcesses
to the same number of CPU cores specified in.apisix.resources.limits.cpu
.The text was updated successfully, but these errors were encountered: