question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Access to docker/runtime options (PID limits)

See original GitHub issue

I’ve been triaging some stability issues with our kubernetes cluster (short version, don’t use centos7 and/or recompile containerd , or you’ll eventually run out of kernel memory and the host will start locking up). After experimenting, I found that a fork bomb triggers the issue quickly. While the kernel memory leak can be fixed/mitigated, I’m now worried about DoS via PID exhaustion, accidental or not.

Docker seems to have PID limits via the run flag --pids-limit. Is it possible to access other docker commandline options like this through the spawner API?

I appreciate the help! I wouldn’t be surprised if the low level argument control is firewalled from the API.

Perhaps pid limits can be enforced inside the container via ulimit, but I’m not sure since that seems like something that would involve the kernel.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
vilhelmencommented, Sep 30, 2019

Thanks for the reminder! I got absolutely nowhere trying to fight kubespawner to accept my config. I didn’t really want to mod the spawner to try and make it accept it. I’m very bad at k8s.

But, more importantly, I have a BIG WARNING for anyone that tries to go the ulimit route: You will super duper mess up jupyter sessions and probably need to set it to like 500+

I tried setting it to 200 and student sessions would eventually grind to a halt. The process limit counts threads and the jupyter worker threads add up incredibly quickly. Jupyter doesn’t fail gracefully when it can’t spawn threads, buttons just stop doing things.

0reactions
consideRatiocommented, Oct 25, 2020

Kubernetes Kubelet, which runs on each k8s node, can be started with --pod-max-pids it seems, but that is not something that KubeSpawner can configure as part of registering a Pod with the k8s api-server. I’ll go ahead and close this issue as unresolvable as part of this project.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Runtime options with Memory, CPUs, and GPUs
Specify the runtime options for a container. ... You can set various constraints to limit a given container's access to the host machine's...
Read more >
Process ID Limits And Reservations - Kubernetes
Kubernetes allow you to limit the number of process IDs (PIDs) that a Pod can use. You can also reserve a number of...
Read more >
Container's PIDs cgroup limit parameter is set - Datadog Docs
A PidsLimit of 0 or -1 means that any number of processes can be forked concurrently inside the container. docker ps --quiet --all...
Read more >
docker-run - Run a command in a new container
For that reason docker run has more options than any other Docker command. ... Note: the host mode gives the container full access...
Read more >
Task definition parameters - Amazon Elastic Container Service
On Windows container instances, the CPU limit is enforced as an absolute quota. Windows containers only have access to the specified amount of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found