Giter Club home page Giter Club logo

Comments (3)

jaydrogers avatar jaydrogers commented on June 20, 2024

This issue seems like it might be deeper in the NGINX configuration, correct?

I am providing the defaults of NGINX and the steps to reproduce are pretty vague -- especially for people who don't run K8s everyday.

Are you aware of any NGINX directives that need to be changed?

from docker-php.

jaydrogers avatar jaydrogers commented on June 20, 2024

Closing for inactivity. Feel free to publish replication steps if you'd like to see this re-opened.

from docker-php.

Raboo avatar Raboo commented on June 20, 2024

I did write a response. But it's not here. Don't know what happened.. This is not specific to k8s.

"worker_processes auto;" won't work as you think it should inside cgroups-controlled environment (such as docker or lxc or whatelse).

nginx relies on sysconf(_SC_NPROCESSORS_ONLN) call to determine the number of available CPUs to spawn the workers accordingly. Unfortunately in cgroups this does not work and the number of CPUs is not changing whether you define a cpu subset or not.

So it's a cgroup thing, not kubernetes. "auto" will always use the number of cores available to the underlying host wether it's a VM or bare-metal, it won't use the limits set by cgroup or cgroup2.

It's harder to mimic this problem in MacOS since Docker/Podman creates a virtual machine with limited resources for the Docker/Podman container. But in a real prod environment running on Linux you should be able to replicate this issue. Doesn't need to be a k8s cluster. You can run a cheap virtual machine with 2 cores and start a docker container inside it that is limited to use 1 core, you will see two worker processes inside the running container.

from docker-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.