Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change: update the default value about enable_cpu_affinity #8074

Merged
merged 7 commits into from
Oct 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conf/config-default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,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

Expand Down
18 changes: 9 additions & 9 deletions t/cli/test_main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -446,13 +446,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' .

Expand Down Expand Up @@ -558,18 +558,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
Expand Down