This is an automated email from the ASF dual-hosted git repository.

spacewander pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/master by this push:
     new 02af68ad7 change: update the default value about enable_cpu_affinity 
(#8074)
02af68ad7 is described below

commit 02af68ad7fa9a77c37a562b9f73735f223d17aad
Author: chengxiaolan <[email protected]>
AuthorDate: Wed Oct 19 09:27:40 2022 +0800

    change: update the default value about enable_cpu_affinity (#8074)
    
    Co-authored-by: 罗泽轩 <[email protected]>
---
 conf/config-default.yaml |  2 +-
 t/cli/test_main.sh       | 18 +++++++++---------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/conf/config-default.yaml b/conf/config-default.yaml
index 78bee8600..526c65866 100755
--- a/conf/config-default.yaml
+++ b/conf/config-default.yaml
@@ -131,7 +131,7 @@ nginx_config:                     # config for render the 
template to generate n
   error_log: logs/error.log
   error_log_level:  warn          # warn,error
   worker_processes: auto          # if you want use multiple cores in 
container, you can inject the number of cpu as environment variable 
"APISIX_WORKER_PROCESSES"
-  enable_cpu_affinity: true       # enable cpu affinity, this is just work 
well only on physical machine
+  enable_cpu_affinity: false      # disable CPU affinity by default, if APISIX 
is deployed on a physical machine, it can be enabled and work well.
   worker_rlimit_nofile: 20480     # the number of files a worker process can 
open, should be larger than worker_connections
   worker_shutdown_timeout: 240s   # timeout for a graceful shutdown of worker 
processes
 
diff --git a/t/cli/test_main.sh b/t/cli/test_main.sh
index ecd55bf3d..f5b78be7f 100755
--- a/t/cli/test_main.sh
+++ b/t/cli/test_main.sh
@@ -461,13 +461,13 @@ git checkout conf/config.yaml
 
 make init
 
-grep -E "worker_cpu_affinity" conf/nginx.conf > /dev/null
-if [ ! $? -eq 0 ]; then
-    echo "failed: nginx.conf file is missing worker_cpu_affinity configuration"
+count=`grep -c "worker_cpu_affinity" conf/nginx.conf  || true`
+if [ $count -ne 0 ]; then
+    echo "failed: nginx.conf file found worker_cpu_affinity when disabling it"
     exit 1
 fi
 
-echo "passed: nginx.conf file contains worker_cpu_affinity configuration"
+echo "passed: nginx.conf file disables cpu affinity"
 
 # check the 'worker_shutdown_timeout' in 'nginx.conf' .
 
@@ -525,18 +525,18 @@ git checkout conf/config.yaml
 
 echo '
 nginx_config:
-  enable_cpu_affinity: false
+  enable_cpu_affinity: true
 ' > conf/config.yaml
 
 make init
 
-count=`grep -c "worker_cpu_affinity" conf/nginx.conf  || true`
-if [ $count -ne 0 ]; then
-    echo "failed: nginx.conf file found worker_cpu_affinity when disable it"
+grep -E "worker_cpu_affinity" conf/nginx.conf > /dev/null
+if [ ! $? -eq 0 ]; then
+    echo "failed: nginx.conf file is missing worker_cpu_affinity configuration"
     exit 1
 fi
 
-echo "passed: nginx.conf file disable cpu affinity"
+echo "passed: nginx.conf file contains worker_cpu_affinity configuration"
 
 # set worker processes with env
 git checkout conf/config.yaml

Reply via email to