0

Consider the scenario where I have:

  • 4 replicas of an app
  • 4 cores
  • On load, the app consumes 100% for a single core

Can I tell each replica to only use 50% of the core and if so, would this allow at most 8 simultaneous connections to the app? I have just dipped my toe into this stuff so an feedback would be appreciated.

1 Answer 1

1

In general: No you can't. At least not on the Docker level.

You can maybe code your app in a way that it monitors such metrics and adjusts itself but Docker isn't able to.

What Docker CAN do is limit the app to 50% and kill it if it uses more than that by utilizing resource limits:

docs.docker.com - containers/resource_constraints

docs.docker.com - docker-compose resource limits

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.