brintos

brintos / linux-shallow public Read only

0
0
Text · 2.5 KiB · b409058 Raw
58 lines · plain
1=======================2Network priority cgroup3=======================4 5The Network priority cgroup provides an interface to allow an administrator to6dynamically set the priority of network traffic generated by various7applications8 9Nominally, an application would set the priority of its traffic via the10SO_PRIORITY socket option.  This however, is not always possible because:11 121) The application may not have been coded to set this value132) The priority of application traffic is often a site-specific administrative14   decision rather than an application defined one.15 16This cgroup allows an administrator to assign a process to a group which defines17the priority of egress traffic on a given interface. Network priority groups can18be created by first mounting the cgroup filesystem::19 20	# mount -t cgroup -onet_prio none /sys/fs/cgroup/net_prio21 22With the above step, the initial group acting as the parent accounting group23becomes visible at '/sys/fs/cgroup/net_prio'.  This group includes all tasks in24the system. '/sys/fs/cgroup/net_prio/tasks' lists the tasks in this cgroup.25 26Each net_prio cgroup contains two files that are subsystem specific27 28net_prio.prioidx29  This file is read-only, and is simply informative.  It contains a unique30  integer value that the kernel uses as an internal representation of this31  cgroup.32 33net_prio.ifpriomap34  This file contains a map of the priorities assigned to traffic originating35  from processes in this group and egressing the system on various interfaces.36  It contains a list of tuples in the form <ifname priority>.  Contents of this37  file can be modified by echoing a string into the file using the same tuple38  format. For example::39 40	echo "eth0 5" > /sys/fs/cgroups/net_prio/iscsi/net_prio.ifpriomap41 42This command would force any traffic originating from processes belonging to the43iscsi net_prio cgroup and egressing on interface eth0 to have the priority of44said traffic set to the value 5. The parent accounting group also has a45writeable 'net_prio.ifpriomap' file that can be used to set a system default46priority.47 48Priorities are set immediately prior to queueing a frame to the device49queueing discipline (qdisc) so priorities will be assigned prior to the hardware50queue selection being made.51 52One usage for the net_prio cgroup is with mqprio qdisc allowing application53traffic to be steered to hardware/driver based traffic classes. These mappings54can then be managed by administrators or other networking protocols such as55DCBX.56 57A new net_prio cgroup inherits the parent's configuration.58