What priorities can be used in cgroups net_prio module?












4















Cgroups has a module called net_prio, and by using this module I can set the priority of network traffic generated by various applications. As you can read here, this can be achieved by setting something similar to the following:



echo "eth0 5" > /sys/fs/cgroups/net_prio/iscsi/net_prio.ifpriomap


But there's no info as to what range of priorities I can use.



Let's say there's a program in my system that should have the lowest network priority. What should I use in the pace of 5 ? Are the priorities similar to nice priorities?










share|improve this question



























    4















    Cgroups has a module called net_prio, and by using this module I can set the priority of network traffic generated by various applications. As you can read here, this can be achieved by setting something similar to the following:



    echo "eth0 5" > /sys/fs/cgroups/net_prio/iscsi/net_prio.ifpriomap


    But there's no info as to what range of priorities I can use.



    Let's say there's a program in my system that should have the lowest network priority. What should I use in the pace of 5 ? Are the priorities similar to nice priorities?










    share|improve this question

























      4












      4








      4


      1






      Cgroups has a module called net_prio, and by using this module I can set the priority of network traffic generated by various applications. As you can read here, this can be achieved by setting something similar to the following:



      echo "eth0 5" > /sys/fs/cgroups/net_prio/iscsi/net_prio.ifpriomap


      But there's no info as to what range of priorities I can use.



      Let's say there's a program in my system that should have the lowest network priority. What should I use in the pace of 5 ? Are the priorities similar to nice priorities?










      share|improve this question














      Cgroups has a module called net_prio, and by using this module I can set the priority of network traffic generated by various applications. As you can read here, this can be achieved by setting something similar to the following:



      echo "eth0 5" > /sys/fs/cgroups/net_prio/iscsi/net_prio.ifpriomap


      But there's no info as to what range of priorities I can use.



      Let's say there's a program in my system that should have the lowest network priority. What should I use in the pace of 5 ? Are the priorities similar to nice priorities?







      networking cgroups






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 23 '14 at 5:27









      Mikhail MorfikovMikhail Morfikov

      4,540124573




      4,540124573






















          1 Answer
          1






          active

          oldest

          votes


















          0














          From the Kernel documentation titled: Network priority cgroup.



          excerpt




          net_prio.prioidx



          This file is read-only, and is simply informative. It contains a unique integer value that the kernel uses as an internal representation of this cgroup.



          net_prio.ifpriomap



          This file contains a map of the priorities assigned to traffic originating from
          processes in this group and egressing the system on various interfaces. It
          contains a list of tuples in the form <ifname priority>. Contents of this file
          can be modified by echoing a string into the file using the same tuple format.
          for example:



             echo "eth0 5" > /sys/fs/cgroups/net_prio/iscsi/net_prio.ifpriomap


          This command would force any traffic originating from processes belonging to the iscsi net_prio cgroup and egressing on interface eth0 to have the priority of said traffic set to the value 5. The parent accounting group also has a
          writeable 'net_prio.ifpriomap' file that can be used to set a system default
          priority.




          I believe these priorities work where the higher the number, the higher the precedence. From the tc man page:



          excerpt



             PRIO   The  PRIO  qdisc  is  a non-shaping container for a configurable 
          number of classes which are dequeued in order. This allows for
          easy prioritization of traffic, where lower classes are
          only able to send if higher ones have no packets available. To
          facilitate configuration, Type Of Service bits are honored by
          default.


          So if there are packets for a lower class they have to wait until there aren't any from a higher numbered class.



          References




          • 3.9. net_prio - Red Hat documentation portal






          share|improve this answer





















          • 1





            I think I figured that out, I mean, how to set the lowest priority to a specific program. In cgroups/net_prio/net_prio.ifpriomap I had to set, for example, eth0 3, so the default priority of all processes is 3, and now in a child directory I can easily specify 1 to that program I wanted. Do you know the biggest value the priority may take? There was something about SO_PRIORITY, and this could be 0-6, but I'm not sure.

            – Mikhail Morfikov
            Jan 23 '14 at 6:53











          • @MikhailMorfikov - I do not know the upper end value either, but did see that same note, so I would assume that those are the valid range of values.

            – slm
            Jan 23 '14 at 7:49











          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%2f110527%2fwhat-priorities-can-be-used-in-cgroups-net-prio-module%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









          0














          From the Kernel documentation titled: Network priority cgroup.



          excerpt




          net_prio.prioidx



          This file is read-only, and is simply informative. It contains a unique integer value that the kernel uses as an internal representation of this cgroup.



          net_prio.ifpriomap



          This file contains a map of the priorities assigned to traffic originating from
          processes in this group and egressing the system on various interfaces. It
          contains a list of tuples in the form <ifname priority>. Contents of this file
          can be modified by echoing a string into the file using the same tuple format.
          for example:



             echo "eth0 5" > /sys/fs/cgroups/net_prio/iscsi/net_prio.ifpriomap


          This command would force any traffic originating from processes belonging to the iscsi net_prio cgroup and egressing on interface eth0 to have the priority of said traffic set to the value 5. The parent accounting group also has a
          writeable 'net_prio.ifpriomap' file that can be used to set a system default
          priority.




          I believe these priorities work where the higher the number, the higher the precedence. From the tc man page:



          excerpt



             PRIO   The  PRIO  qdisc  is  a non-shaping container for a configurable 
          number of classes which are dequeued in order. This allows for
          easy prioritization of traffic, where lower classes are
          only able to send if higher ones have no packets available. To
          facilitate configuration, Type Of Service bits are honored by
          default.


          So if there are packets for a lower class they have to wait until there aren't any from a higher numbered class.



          References




          • 3.9. net_prio - Red Hat documentation portal






          share|improve this answer





















          • 1





            I think I figured that out, I mean, how to set the lowest priority to a specific program. In cgroups/net_prio/net_prio.ifpriomap I had to set, for example, eth0 3, so the default priority of all processes is 3, and now in a child directory I can easily specify 1 to that program I wanted. Do you know the biggest value the priority may take? There was something about SO_PRIORITY, and this could be 0-6, but I'm not sure.

            – Mikhail Morfikov
            Jan 23 '14 at 6:53











          • @MikhailMorfikov - I do not know the upper end value either, but did see that same note, so I would assume that those are the valid range of values.

            – slm
            Jan 23 '14 at 7:49
















          0














          From the Kernel documentation titled: Network priority cgroup.



          excerpt




          net_prio.prioidx



          This file is read-only, and is simply informative. It contains a unique integer value that the kernel uses as an internal representation of this cgroup.



          net_prio.ifpriomap



          This file contains a map of the priorities assigned to traffic originating from
          processes in this group and egressing the system on various interfaces. It
          contains a list of tuples in the form <ifname priority>. Contents of this file
          can be modified by echoing a string into the file using the same tuple format.
          for example:



             echo "eth0 5" > /sys/fs/cgroups/net_prio/iscsi/net_prio.ifpriomap


          This command would force any traffic originating from processes belonging to the iscsi net_prio cgroup and egressing on interface eth0 to have the priority of said traffic set to the value 5. The parent accounting group also has a
          writeable 'net_prio.ifpriomap' file that can be used to set a system default
          priority.




          I believe these priorities work where the higher the number, the higher the precedence. From the tc man page:



          excerpt



             PRIO   The  PRIO  qdisc  is  a non-shaping container for a configurable 
          number of classes which are dequeued in order. This allows for
          easy prioritization of traffic, where lower classes are
          only able to send if higher ones have no packets available. To
          facilitate configuration, Type Of Service bits are honored by
          default.


          So if there are packets for a lower class they have to wait until there aren't any from a higher numbered class.



          References




          • 3.9. net_prio - Red Hat documentation portal






          share|improve this answer





















          • 1





            I think I figured that out, I mean, how to set the lowest priority to a specific program. In cgroups/net_prio/net_prio.ifpriomap I had to set, for example, eth0 3, so the default priority of all processes is 3, and now in a child directory I can easily specify 1 to that program I wanted. Do you know the biggest value the priority may take? There was something about SO_PRIORITY, and this could be 0-6, but I'm not sure.

            – Mikhail Morfikov
            Jan 23 '14 at 6:53











          • @MikhailMorfikov - I do not know the upper end value either, but did see that same note, so I would assume that those are the valid range of values.

            – slm
            Jan 23 '14 at 7:49














          0












          0








          0







          From the Kernel documentation titled: Network priority cgroup.



          excerpt




          net_prio.prioidx



          This file is read-only, and is simply informative. It contains a unique integer value that the kernel uses as an internal representation of this cgroup.



          net_prio.ifpriomap



          This file contains a map of the priorities assigned to traffic originating from
          processes in this group and egressing the system on various interfaces. It
          contains a list of tuples in the form <ifname priority>. Contents of this file
          can be modified by echoing a string into the file using the same tuple format.
          for example:



             echo "eth0 5" > /sys/fs/cgroups/net_prio/iscsi/net_prio.ifpriomap


          This command would force any traffic originating from processes belonging to the iscsi net_prio cgroup and egressing on interface eth0 to have the priority of said traffic set to the value 5. The parent accounting group also has a
          writeable 'net_prio.ifpriomap' file that can be used to set a system default
          priority.




          I believe these priorities work where the higher the number, the higher the precedence. From the tc man page:



          excerpt



             PRIO   The  PRIO  qdisc  is  a non-shaping container for a configurable 
          number of classes which are dequeued in order. This allows for
          easy prioritization of traffic, where lower classes are
          only able to send if higher ones have no packets available. To
          facilitate configuration, Type Of Service bits are honored by
          default.


          So if there are packets for a lower class they have to wait until there aren't any from a higher numbered class.



          References




          • 3.9. net_prio - Red Hat documentation portal






          share|improve this answer















          From the Kernel documentation titled: Network priority cgroup.



          excerpt




          net_prio.prioidx



          This file is read-only, and is simply informative. It contains a unique integer value that the kernel uses as an internal representation of this cgroup.



          net_prio.ifpriomap



          This file contains a map of the priorities assigned to traffic originating from
          processes in this group and egressing the system on various interfaces. It
          contains a list of tuples in the form <ifname priority>. Contents of this file
          can be modified by echoing a string into the file using the same tuple format.
          for example:



             echo "eth0 5" > /sys/fs/cgroups/net_prio/iscsi/net_prio.ifpriomap


          This command would force any traffic originating from processes belonging to the iscsi net_prio cgroup and egressing on interface eth0 to have the priority of said traffic set to the value 5. The parent accounting group also has a
          writeable 'net_prio.ifpriomap' file that can be used to set a system default
          priority.




          I believe these priorities work where the higher the number, the higher the precedence. From the tc man page:



          excerpt



             PRIO   The  PRIO  qdisc  is  a non-shaping container for a configurable 
          number of classes which are dequeued in order. This allows for
          easy prioritization of traffic, where lower classes are
          only able to send if higher ones have no packets available. To
          facilitate configuration, Type Of Service bits are honored by
          default.


          So if there are packets for a lower class they have to wait until there aren't any from a higher numbered class.



          References




          • 3.9. net_prio - Red Hat documentation portal







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Feb 10 '14 at 9:59









          myroslav

          1134




          1134










          answered Jan 23 '14 at 6:15









          slmslm

          254k71538687




          254k71538687








          • 1





            I think I figured that out, I mean, how to set the lowest priority to a specific program. In cgroups/net_prio/net_prio.ifpriomap I had to set, for example, eth0 3, so the default priority of all processes is 3, and now in a child directory I can easily specify 1 to that program I wanted. Do you know the biggest value the priority may take? There was something about SO_PRIORITY, and this could be 0-6, but I'm not sure.

            – Mikhail Morfikov
            Jan 23 '14 at 6:53











          • @MikhailMorfikov - I do not know the upper end value either, but did see that same note, so I would assume that those are the valid range of values.

            – slm
            Jan 23 '14 at 7:49














          • 1





            I think I figured that out, I mean, how to set the lowest priority to a specific program. In cgroups/net_prio/net_prio.ifpriomap I had to set, for example, eth0 3, so the default priority of all processes is 3, and now in a child directory I can easily specify 1 to that program I wanted. Do you know the biggest value the priority may take? There was something about SO_PRIORITY, and this could be 0-6, but I'm not sure.

            – Mikhail Morfikov
            Jan 23 '14 at 6:53











          • @MikhailMorfikov - I do not know the upper end value either, but did see that same note, so I would assume that those are the valid range of values.

            – slm
            Jan 23 '14 at 7:49








          1




          1





          I think I figured that out, I mean, how to set the lowest priority to a specific program. In cgroups/net_prio/net_prio.ifpriomap I had to set, for example, eth0 3, so the default priority of all processes is 3, and now in a child directory I can easily specify 1 to that program I wanted. Do you know the biggest value the priority may take? There was something about SO_PRIORITY, and this could be 0-6, but I'm not sure.

          – Mikhail Morfikov
          Jan 23 '14 at 6:53





          I think I figured that out, I mean, how to set the lowest priority to a specific program. In cgroups/net_prio/net_prio.ifpriomap I had to set, for example, eth0 3, so the default priority of all processes is 3, and now in a child directory I can easily specify 1 to that program I wanted. Do you know the biggest value the priority may take? There was something about SO_PRIORITY, and this could be 0-6, but I'm not sure.

          – Mikhail Morfikov
          Jan 23 '14 at 6:53













          @MikhailMorfikov - I do not know the upper end value either, but did see that same note, so I would assume that those are the valid range of values.

          – slm
          Jan 23 '14 at 7:49





          @MikhailMorfikov - I do not know the upper end value either, but did see that same note, so I would assume that those are the valid range of values.

          – slm
          Jan 23 '14 at 7:49


















          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%2f110527%2fwhat-priorities-can-be-used-in-cgroups-net-prio-module%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 make a Squid Proxy server?

          Is this a new Fibonacci Identity?

          19世紀