haystack-ui icon indicating copy to clipboard operation
haystack-ui copied to clipboard

Docker container does not respect resource limits

Open worldtiki opened this issue 7 years ago • 1 comments

Scenario Deploy a docker container with the latest haystack ui tag and specify a cpu limit.

Expected The Node process respects the resource limits and only sees the number of cpus allocated.

Actual The Node process sees all the cpus of the host.

Notes The problem affects the performance of the server by doing an unnecessary number of forks here: https://github.com/ExpediaDotCom/haystack-ui/blob/ee08389ba9d269eb19094c6c72d4d6c98baec964/server/utils/server.js#L55 This is worse when running in a highly virtualized platform like Kubernetes where it's common to define cpu (and memory!) limits for each container.

I believe this is similar to this issue that affects Java containers.

If Node does not provide a solution a possible workaround would be to expose the number of cpus as a property and allow users to override it.

worldtiki avatar Oct 18 '18 19:10 worldtiki

@kapilra : Can you have a look at this.

shreyaa-sharma avatar Sep 03 '19 17:09 shreyaa-sharma