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

feat: As a user, I want to set enable_cpu_affinity default to false, so that it won't affect running APISIX via container #8042

Closed
spacewander opened this issue Oct 8, 2022 · 6 comments · Fixed by #8074
Assignees
Labels
good first issue Good for newcomers

Comments

@spacewander
Copy link
Member

Description

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.

The worker_processes option also has a similar problem, but changing this option will bring enormous breaking change.

@spacewander spacewander added the good first issue Good for newcomers label Oct 8, 2022
@kellyseeme
Copy link

how worker_processes set in k8s enviroment? if there set the cpu and mem request and limit.

@tokers
Copy link
Contributor

tokers commented Oct 8, 2022

how worker_processes set in k8s enviroment? if there set the cpu and mem request and limit.

The default value of worker_processes is auto (see https://github.com/apache/apisix-helm-chart/blob/master/charts/apisix/values.yaml#L214) if you install APISIX via helm chart.

@tokers
Copy link
Contributor

tokers commented Oct 8, 2022

how worker_processes set in k8s enviroment? if there set the cpu and mem request and limit.

The default value of worker_processes is auto (see https://github.com/apache/apisix-helm-chart/blob/master/charts/apisix/values.yaml#L214) if you install APISIX via helm chart.

The number of APISIX worker processes is not related to the CPU / memory request & limitation. By the way, this is off the topic.

@Hazel6869
Copy link
Contributor

Hi, can you assign the issue to me ? @spacewander

@kellyseeme
Copy link

@tokers thanks for reply,maybe the woker_processes is the relevent topic.if we set auto,this worker_processes is set to the node of the number cpus,maybe this is not resonable。

In kubernetes, nginx spawn worker processes depending on the resource request for the pod by default. e.g if you have the following in your deployment:

resources:
requests:
memory: 2048Mi
cpu: 2000m
Then nginx will spawn 2 worker process (2000 milli cpu = 2 cpu)

@tokers
Copy link
Contributor

tokers commented Oct 11, 2022

In kubernetes, nginx spawn worker processes depending on the resource request for the pod by default. e.g if you have the following in your deployment:

Any docs about it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants