How do I read the systemd MemoryHigh value from the /sys/fs/cgroup filesystem?
Clash Royale CLAN TAG#URR8PPP
I have a systemd service that sets MemoryHigh
and MemoryMax
. If I look under its cgroup in /sys/fs/cgroup/memory
the memory.limit_in_bytes
file matches the limit set by MemoryMax
, but where do I find the value set by MemoryHigh
? There is a file named memory.soft_limit_in_bytes
so I expected it to be that, but its value is always 9223372036854771712 (8 EB?).
The doc for MemoryHigh says
This controls the "memory.high" control group attribute
but there is no file with that name.
This is on Ubuntu 18.04.
systemd cgroups
add a comment |
I have a systemd service that sets MemoryHigh
and MemoryMax
. If I look under its cgroup in /sys/fs/cgroup/memory
the memory.limit_in_bytes
file matches the limit set by MemoryMax
, but where do I find the value set by MemoryHigh
? There is a file named memory.soft_limit_in_bytes
so I expected it to be that, but its value is always 9223372036854771712 (8 EB?).
The doc for MemoryHigh says
This controls the "memory.high" control group attribute
but there is no file with that name.
This is on Ubuntu 18.04.
systemd cgroups
add a comment |
I have a systemd service that sets MemoryHigh
and MemoryMax
. If I look under its cgroup in /sys/fs/cgroup/memory
the memory.limit_in_bytes
file matches the limit set by MemoryMax
, but where do I find the value set by MemoryHigh
? There is a file named memory.soft_limit_in_bytes
so I expected it to be that, but its value is always 9223372036854771712 (8 EB?).
The doc for MemoryHigh says
This controls the "memory.high" control group attribute
but there is no file with that name.
This is on Ubuntu 18.04.
systemd cgroups
I have a systemd service that sets MemoryHigh
and MemoryMax
. If I look under its cgroup in /sys/fs/cgroup/memory
the memory.limit_in_bytes
file matches the limit set by MemoryMax
, but where do I find the value set by MemoryHigh
? There is a file named memory.soft_limit_in_bytes
so I expected it to be that, but its value is always 9223372036854771712 (8 EB?).
The doc for MemoryHigh says
This controls the "memory.high" control group attribute
but there is no file with that name.
This is on Ubuntu 18.04.
systemd cgroups
systemd cgroups
edited Feb 5 at 16:09
Stephen Kitt
173k24397472
173k24397472
asked Feb 5 at 16:04
EM0EM0
1635
1635
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
The resource control documentation also mentions that
MemoryLow=
andMemoryHigh=
are effective only on unified hierarchy.
“Unified hierarchy” means cgroup v2 only; you’re using v1 or hybrid mode. To use unified hierarchy, if it’s not the default, the system should be booted with the systemd.unified_cgroup_hierarchy
option.
Ah, that's a good point. It's actually in hybrid mode, so I have/sys/fs/cgroup/unified/MY_SLICE_NAME
as well, but there is nothing related to memory under there. Does this mean there is no way to see the MemoryHigh value in hybrid mode?
– EM0
Feb 5 at 16:50
It turns out that "unified hierarchy" means "only cgroups v2" - in hybrid mode MemoryHigh is silently ignored! So I had to set the systemd.unified_cgroup_hierarchy kernel boot option to get this to work.
– EM0
Feb 6 at 10:05
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f498837%2fhow-do-i-read-the-systemd-memoryhigh-value-from-the-sys-fs-cgroup-filesystem%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The resource control documentation also mentions that
MemoryLow=
andMemoryHigh=
are effective only on unified hierarchy.
“Unified hierarchy” means cgroup v2 only; you’re using v1 or hybrid mode. To use unified hierarchy, if it’s not the default, the system should be booted with the systemd.unified_cgroup_hierarchy
option.
Ah, that's a good point. It's actually in hybrid mode, so I have/sys/fs/cgroup/unified/MY_SLICE_NAME
as well, but there is nothing related to memory under there. Does this mean there is no way to see the MemoryHigh value in hybrid mode?
– EM0
Feb 5 at 16:50
It turns out that "unified hierarchy" means "only cgroups v2" - in hybrid mode MemoryHigh is silently ignored! So I had to set the systemd.unified_cgroup_hierarchy kernel boot option to get this to work.
– EM0
Feb 6 at 10:05
add a comment |
The resource control documentation also mentions that
MemoryLow=
andMemoryHigh=
are effective only on unified hierarchy.
“Unified hierarchy” means cgroup v2 only; you’re using v1 or hybrid mode. To use unified hierarchy, if it’s not the default, the system should be booted with the systemd.unified_cgroup_hierarchy
option.
Ah, that's a good point. It's actually in hybrid mode, so I have/sys/fs/cgroup/unified/MY_SLICE_NAME
as well, but there is nothing related to memory under there. Does this mean there is no way to see the MemoryHigh value in hybrid mode?
– EM0
Feb 5 at 16:50
It turns out that "unified hierarchy" means "only cgroups v2" - in hybrid mode MemoryHigh is silently ignored! So I had to set the systemd.unified_cgroup_hierarchy kernel boot option to get this to work.
– EM0
Feb 6 at 10:05
add a comment |
The resource control documentation also mentions that
MemoryLow=
andMemoryHigh=
are effective only on unified hierarchy.
“Unified hierarchy” means cgroup v2 only; you’re using v1 or hybrid mode. To use unified hierarchy, if it’s not the default, the system should be booted with the systemd.unified_cgroup_hierarchy
option.
The resource control documentation also mentions that
MemoryLow=
andMemoryHigh=
are effective only on unified hierarchy.
“Unified hierarchy” means cgroup v2 only; you’re using v1 or hybrid mode. To use unified hierarchy, if it’s not the default, the system should be booted with the systemd.unified_cgroup_hierarchy
option.
edited Feb 6 at 10:40
answered Feb 5 at 16:07
Stephen KittStephen Kitt
173k24397472
173k24397472
Ah, that's a good point. It's actually in hybrid mode, so I have/sys/fs/cgroup/unified/MY_SLICE_NAME
as well, but there is nothing related to memory under there. Does this mean there is no way to see the MemoryHigh value in hybrid mode?
– EM0
Feb 5 at 16:50
It turns out that "unified hierarchy" means "only cgroups v2" - in hybrid mode MemoryHigh is silently ignored! So I had to set the systemd.unified_cgroup_hierarchy kernel boot option to get this to work.
– EM0
Feb 6 at 10:05
add a comment |
Ah, that's a good point. It's actually in hybrid mode, so I have/sys/fs/cgroup/unified/MY_SLICE_NAME
as well, but there is nothing related to memory under there. Does this mean there is no way to see the MemoryHigh value in hybrid mode?
– EM0
Feb 5 at 16:50
It turns out that "unified hierarchy" means "only cgroups v2" - in hybrid mode MemoryHigh is silently ignored! So I had to set the systemd.unified_cgroup_hierarchy kernel boot option to get this to work.
– EM0
Feb 6 at 10:05
Ah, that's a good point. It's actually in hybrid mode, so I have
/sys/fs/cgroup/unified/MY_SLICE_NAME
as well, but there is nothing related to memory under there. Does this mean there is no way to see the MemoryHigh value in hybrid mode?– EM0
Feb 5 at 16:50
Ah, that's a good point. It's actually in hybrid mode, so I have
/sys/fs/cgroup/unified/MY_SLICE_NAME
as well, but there is nothing related to memory under there. Does this mean there is no way to see the MemoryHigh value in hybrid mode?– EM0
Feb 5 at 16:50
It turns out that "unified hierarchy" means "only cgroups v2" - in hybrid mode MemoryHigh is silently ignored! So I had to set the systemd.unified_cgroup_hierarchy kernel boot option to get this to work.
– EM0
Feb 6 at 10:05
It turns out that "unified hierarchy" means "only cgroups v2" - in hybrid mode MemoryHigh is silently ignored! So I had to set the systemd.unified_cgroup_hierarchy kernel boot option to get this to work.
– EM0
Feb 6 at 10:05
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f498837%2fhow-do-i-read-the-systemd-memoryhigh-value-from-the-sys-fs-cgroup-filesystem%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown