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

nomad coping with OS resources limits #6557

Open
notnoop opened this issue Oct 25, 2019 · 1 comment
Open

nomad coping with OS resources limits #6557

notnoop opened this issue Oct 25, 2019 · 1 comment

Comments

@notnoop
Copy link
Contributor

notnoop commented Oct 25, 2019

When aiming to run many allocations on a single client, it is easy to overlook adjusting the OS resource limits and have nomad hits these limits. As of 0.10.0, Nomad may start user allocations but partially crash before persisting their state, resulting into many leaked processes that Nomad no longer manages. When a client gets to that state, the best option is to destroy client.

Some sample flags for linux:

Hitting these limits is damaging to many other critical services, even if Nomad remained healthy. Docker has some known issues and some guidance for tweaking these values[1][2].

We can try to address this by many means; here is a sample of possible actions:

  • Documentation:
    • Highlight above limits and any other relevant ones in Guides for productionizing nomad
    • Possibly, highlight sample error messages and logs that are related to above
    • Issue guidance for monitoring resource exhausion in system and how to best set alerts
  • PreFlight Checks:
    • Have nomad issue warnings/alerts if limits are low or if a client is close to exhausting
  • Resiliency patterns
    • Before running a task, reserve resources that are needed for task and fail if not enough
    • Handle resources exhaustion and ensure that any started tasks get leaked
    • Ensure that a client that consistently fail to start clients is marked unhealthy and no longer is assigned work

[1] https://success.docker.com/article/how-to-reserve-resource-temporarily-unavailable-errors-due-to-tasksmax-setting
[2] docker/for-linux#73

@tgross
Copy link
Member

tgross commented Nov 1, 2019

Another example I just documented in #6607 is kernel tunables for bridge networking, which took up a lot of time to figure out in #6580 (comment)

In that scenario we want a particular set of tunables for network namespace / Connect support, but probably don't want to enforce them because it'll break the QEMU task driver:

net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-arptables = 1

(These aren't strictly "resource limitations" but can be set at runtime on clients and change outside of Nomad's control, so I suspect the solutions are going to be similar.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants