Show Table of Contents
3.9. net_prio
The Network Priority (
net_prio) subsystem provides a way to dynamically set the priority of network traffic per each network interface for applications within various cgroups. A network's priority is a number assigned to network traffic and used internally by the system and network devices. Network priority is used to differentiate packets that are sent, queued, or dropped. The tc command may be used to set a network's priority (setting the network priority via the tc command is outside the scope of this guide; for more information, refer to the tc man page).
Typically, an application sets the priority of its traffic via the
SO_PRIORITY socket option. However, applications are often not coded to set the priority value, or the application's traffic is site-specific and does not provide a defined priority.
Using the
net_prio subsystem in a cgroup allows the administrator to assign a process to a specific cgroup which defines the priority of outgoing traffic on a given network interface.
Note
The
net_prio subsystem is not compiled in the kernel like the rest of the subsystems, rather it is a module that has to be loaded before attempting to mount it. To load this module, type as root:
modprobenetprio_cgroup
The following tunable parameters are available for the
memory subsystem.
- net_prio.prioidx
- a read-only file which contains a unique integer value that the kernel uses as an internal representation of this cgroup.
- net_prio.ifpriomap
- contains a map of priorities assigned to traffic originating from processes in this group and leaving the system on various interfaces. This map is represented by a list of pairs in the form
<network_interface> <priority>:~]#
cat /cgroup/net_prio/iscsi/net_prio.ifpriomapeth0 5 eth1 4 eth2 6Contents of thenet_prio.ifpriomapfile can be modified by echoing a string into the file using the above format, for example:~]#
echo "eth0 5" > /cgroup/net_prio/iscsi/net_prio.ifpriomapThe above command forces any traffic originating from processes belonging to theiscsinet_priocgroup, and with traffic outgoing on theeth0network interface, to have the priority set to the value of5. The parent cgroup also has a writablenet_prio.ifpriomapfile that can be used to set a system default priority.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.