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
[RHPAM-4777] - Dynamic resources script is reading wrong container sy… #423
Conversation
…s files on cgroupsv2 Signed-off-by: Your Name <fspolti@redhat.com>
Hey @spolti , thanks for tagging me for review. A first comment, we took a quite different approach in the openjdk images: since OpenJDK itself can now detect cgroups v1 or v2, we moved away from doing any kind of resource limit detection/setting in the wrapper scripts, and deleted container-limits script entirely. See e.g. I see that this PR is very similar to apache/incubator-kie-kogito-images#1676, is that community/upstream? |
Hi @jmtd, the auto tune feature is since Java 17, right? Yes, the second PR is Kogito upstream. |
Cgroups V2 support is in JDK8, 11 and 17. For auto-tuning, I guess it depends which variable we are talking about, but I'm fairly sure it's been in all of them for the ones above for some time.
I don't really know anything about VM tuning for GraalVM so can't comment here! |
That's nice, that can be a good addition, but I am afraid that, as RHPAM is on maintenance and I am leaving the RHPAM team, anyone will be able to migrate and test it. With that said, it could be better rely on this proposed changes.
It is used by Kogito images (community only). @radtriste @ricardozanini, thoughts on this? (could be a good addition for the future) PS I don't know why I edited your comment instead replying it =/ |
fi | ||
else | ||
# v2 | ||
local mem_file="/sys/fs/cgroup/memory.max" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This path is only correct if the processes' cgroup is the root one. I.e., the result of awk -F: '{ print $3 }' /proc/$$/cgroup
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be that this is always true in the contexts you care about, i.e., container with a java process as PID 1. It's not true on my desktop, for example, when testing the script logic:
$ cat /sys/fs/cgroup/memory.max
cat: /sys/fs/cgroup/memory.max: No such file or directory
$ awk -F: '{ print $3 }' /proc/$$/cgroup
/user.slice/user-1000.slice/session-300.scope
$ cat /sys/fs/cgroup/$(awk -F: '{ print $3 }' /proc/$$/cgroup)/memory.max
max
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In containers, yes, I didn't spot any other different path, this should be enough.
Good luck with your future projects! I think given you are leaving it makes a lot of sense to align this with community as closely as possible. Since my product won't consume these changes, I haven't done an approval, but I wanted to run and test the code for you anyway, so I've done that and I think it's fine: my comment about the cgroup path is probably moot since I guess in the important container runtimes the process will be bound to the root cgroup and there won't be a heirarchy. |
@spolti Are these changes not going into main as well? |
@luck3y hi, are you ok if we merge this one? |
lgtm @spolti, I think we should at least cherry pick to main, otherwise it'll get lost. |
…s files on cgroupsv2 (jboss-openshift#423) Signed-off-by: Your Name <fspolti@redhat.com>
…s files on cgroupsv2
Thanks for submitting your Pull Request!
Please make sure your PR meets the following requirements:
[CLOUD-XYA] Subject
CONTRIBUTING.md
)Signed-off-by: Your Name <yourname@example.com>
- usegit commit -s