You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/10/11 09:27:17 UTC

[GitHub] [apisix] Hazel6869 opened a new pull request, #8074: feat: update the default value about enable_cpu_affinity

Hazel6869 opened a new pull request, #8074:
URL: https://github.com/apache/apisix/pull/8074

   ### Description
   
   <!-- Please include a summary of the change and which issue is fixed. -->
   <!-- Please also include relevant motivation and context. -->
   
   Nowadays, more and more users deploy APISIX via container. As Nginx's worker_cpu_affinity doesn't count with cgroup, enabling worker_cpu_affinity by default will affect the behavior of APISIX, for instance, multiple instances will be bound to one CPU. To avoid this problem, it would be better to disable CPU affinity option by default in the conf/config-default.yaml.
   
   Fixes # (https://github.com/apache/apisix/issues/8042)
   
   ### Checklist
   
   - [ ] I have explained the need for this PR and the problem it solves
   - [ ] I have explained the changes or the new features added to this PR
   - [ ] I have added tests corresponding to this change
   - [ ] I have updated the documentation to reflect this change
   - [ ] I have verified that this change is backward compatible (If not, please discuss on the [APISIX mailing list](https://github.com/apache/apisix/tree/master#community) first)
   
   <!--
   
   Note
   
   1. Mark the PR as draft until it's ready to be reviewed.
   2. Always add/update tests for any changes unless you have a good reason.
   3. Always update the documentation to reflect the changes made in the PR.
   4. Make a new commit to resolve conversations instead of `push -f`.
   5. To resolve merge conflicts, merge master instead of rebasing.
   6. Use "request review" to notify the reviewer after making changes.
   7. Only a reviewer can mark a conversation as resolved.
   
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] spacewander merged pull request #8074: change: update the default value about enable_cpu_affinity

Posted by GitBox <gi...@apache.org>.
spacewander merged PR #8074:
URL: https://github.com/apache/apisix/pull/8074


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] spacewander commented on a diff in pull request #8074: change: update the default value about enable_cpu_affinity

Posted by GitBox <gi...@apache.org>.
spacewander commented on code in PR #8074:
URL: https://github.com/apache/apisix/pull/8074#discussion_r995349466


##########
t/cli/test_main.sh:
##########
@@ -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 disable it"

Review Comment:
   ```suggestion
       echo "failed: nginx.conf file found worker_cpu_affinity when disabling it"
   ```



##########
t/cli/test_main.sh:
##########
@@ -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 disable it"
     exit 1
 fi
 
-echo "passed: nginx.conf file contains worker_cpu_affinity configuration"
+echo "passed: nginx.conf file disable cpu affinity"

Review Comment:
   ```suggestion
   echo "passed: nginx.conf file disables cpu affinity"
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] Hazel6869 commented on a diff in pull request #8074: change: update the default value about enable_cpu_affinity

Posted by GitBox <gi...@apache.org>.
Hazel6869 commented on code in PR #8074:
URL: https://github.com/apache/apisix/pull/8074#discussion_r994085188


##########
conf/config-default.yaml:
##########
@@ -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       # enable cpu affinity, this is just work well only on physical machine

Review Comment:
   > 
   
   Thanks, I have changed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] tzssangglass commented on a diff in pull request #8074: change: update the default value about enable_cpu_affinity

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on code in PR #8074:
URL: https://github.com/apache/apisix/pull/8074#discussion_r994048496


##########
conf/config-default.yaml:
##########
@@ -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       # enable cpu affinity, this is just work well only on physical machine

Review Comment:
   ```suggestion
     enable_cpu_affinity: false       # disable CPU affinity by default, if APISIX is deployed on a physical machine, it can be enabled and work well.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] spacewander commented on pull request #8074: change: update the default value about enable_cpu_affinity

Posted by GitBox <gi...@apache.org>.
spacewander commented on PR #8074:
URL: https://github.com/apache/apisix/pull/8074#issuecomment-1278497078

   Don't forget to update the commit message like https://github.com/apache/apisix/pull/8051#issuecomment-1274394803 in your PRs.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] Hazel6869 commented on pull request #8074: change: update the default value about enable_cpu_affinity

Posted by GitBox <gi...@apache.org>.
Hazel6869 commented on PR #8074:
URL: https://github.com/apache/apisix/pull/8074#issuecomment-1278721741

   > Don't forget to update the commit message like [#8051 (comment)](https://github.com/apache/apisix/pull/8051#issuecomment-1274394803) in your PRs.
   
   Thank your suggestion, I have changed. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] spacewander commented on pull request #8074: change: update the default value about enable_cpu_affinity

Posted by GitBox <gi...@apache.org>.
spacewander commented on PR #8074:
URL: https://github.com/apache/apisix/pull/8074#issuecomment-1278897403

   > > Don't forget to update the commit message like [#8051 (comment)](https://github.com/apache/apisix/pull/8051#issuecomment-1274394803) in your PRs.
   > 
   > Thank your suggestion, I have changed.
   
   Err, it should be `Fixes #8042`, not `Fixes (#8042)`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org