How do I read the systemd MemoryHigh value from the /sys/fs/cgroup filesystem?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












1















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.










share|improve this question




























    1















    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.










    share|improve this question


























      1












      1








      1








      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.










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 5 at 16:09









      Stephen Kitt

      173k24397472




      173k24397472










      asked Feb 5 at 16:04









      EM0EM0

      1635




      1635




















          1 Answer
          1






          active

          oldest

          votes


















          3














          The resource control documentation also mentions that




          MemoryLow= and MemoryHigh= 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.






          share|improve this answer

























          • 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










          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
          );



          );













          draft saved

          draft discarded


















          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









          3














          The resource control documentation also mentions that




          MemoryLow= and MemoryHigh= 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.






          share|improve this answer

























          • 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















          3














          The resource control documentation also mentions that




          MemoryLow= and MemoryHigh= 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.






          share|improve this answer

























          • 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













          3












          3








          3







          The resource control documentation also mentions that




          MemoryLow= and MemoryHigh= 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.






          share|improve this answer















          The resource control documentation also mentions that




          MemoryLow= and MemoryHigh= 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.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          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

















          • 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

















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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






          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?