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

Is there a way to disable memory limits for docker containers. #7235

Closed
ryanmickler opened this issue Feb 28, 2020 · 3 comments
Closed

Is there a way to disable memory limits for docker containers. #7235

ryanmickler opened this issue Feb 28, 2020 · 3 comments

Comments

@ryanmickler
Copy link
Contributor

On my nomad agent, I only have two tasks running: a database service and a logging sidecar.

This database container is designed to max out memory usage on the host. I want to be able to disable nomad's ability to OOM kill this process, because although sometimes it uses 99.5% of the memory on the host, it is designed to.

Is there a way to do this?

Nomad Version 0.8.7

@www-aiqu-no
Copy link

Rhe nomad docker plugin doesn't currently support this (memory is hard limit), but you could configure the client to advertise more memory than it actually has:

https://nomadproject.io/docs/configuration/client/#inlinecode-memory_total_mb

Would probably introduce more/other problems..

I think this would be best to configure in the task itself. What is the database, and is there no way to enforce restriction on resources? You can set the amount of memory allocated to each docker task (resource parameter), and this value is available to the container

@shoenig
Copy link
Contributor

shoenig commented Mar 2, 2020

Hey @ryanmickler thanks for the use case! With the docker driver, the memory resource ascribed to the task (configurable w/ default 300MB) is going to be enforced - there isn't currently a way to disable that with Nomad. To directly achieve what you ask, you could resort to the raw_exec driver which will not enforce memory use - there's a similar thread of discussion in #2082. (Of course, the risk of the kernel's OOM killer unexpectedly killing important system processes like sshd or the nomad agent apply - one of the key benefits of Nomad is being able to isolate tasks using the advanced drivers).

In the future we would like to add support for "soft" memory limits, enabling an over-subscription use case which may help here, but that doesn't exist yet.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants