Skip to content

Docker container does not respect resource limits #414

@worldtiki

Description

@worldtiki

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:

cluster.fork();

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions