Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

CPU and memory resource detection should be Docker container aware. #377

Open
jacarey opened this issue Apr 15, 2020 · 1 comment
Open

Comments

@jacarey
Copy link
Contributor

jacarey commented Apr 15, 2020

Background:

Docker can put memory and cpu limits on processes running inside of containers that are a subset of all system resources. However, the current resource detection in dagr is not aware of the control groups that limit the resource usage in a container.

Because of this there is the potential for the dagr pipeline to over allocate resources which can cause out of memory container exits.

Potential Solutions

The current resource detection uses the oshi library who's recommended "fix" is to read the limits from the files on the underlying OS that contain them. oshi/oshi#893

This requires the resource detection to have logic to determine if it is running in a container environment and where to look for those files if it is.

Alternatively, JDK 10 has docker aware resource detection that has been back-ported to JDK 8 v191+

https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8196595

These features are on be default so resource querying does not need any logic to determine if it is running in a container or not.

@clintval
Copy link
Member

I am +1 on this! The bug is rarely hit for me, but when it appears, the entire job comes crashing down.

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

No branches or pull requests

2 participants