Defining Priority Queues


As priority queueing is much simpler than class-based queueing, we'll look at that first. Use an entry like the following to enable PRIQ on your system's Internet-facing Ethernet interface.

 altq on fxp1 1 priq bandwidth 2 100Mb queue { 3 ssh, 4 other} 

We define 1 PRIQ on this interface, so any other queues on this interface are also priority queues. We have 2 100 MB to work with, which we want to split into the queues 3 ssh and 4 other.

Each queue under the parent queue must have a unique name. While you can use any names you like, it's best if they actually mean something. If you have a special queue set aside for SSH, then you could do worse than naming the queue "ssh."

Child queues are defined in a similar manner:

 queue queue-name 1 priority priority 2 priq(options) 

1 Priorities in PRIQ run from 0 to 15, with 0 being "no priority" and 15 being "maximum priority." Traffic with a priority of 15 will be handled before traffic of any other priority. If there is no priority 15 traffic, priority 14 traffic will be handled, and so on.

We can also enable 2 options on the queue, such as "red" or "default" (see "Queue Options"), by listing "priq" and the option name in parenthesis. If you have no options for a particular queue, you do not need this term.

Here, we define two PRIQ child queues. In PRIQ, child queues cannot have children of their own.

 queue ssh 1 priority 15 queue other priority 8 2 priq(default) 

In this case, we're going to use priority queueing to give SSH traffic 1 priority over everything else. As SSH traffic is generally only used by the system administrator, but is usually only a small amount of traffic, this gives a quick-and-dirty method of prioritizing emergency logins while not interfering too badly with the applications. Every other application is placed in the default queue.




Absolute Openbsd(c) Unix for the Practical Paranoid
Absolute OpenBSD: Unix for the Practical Paranoid
ISBN: 1886411999
EAN: 2147483647
Year: 2005
Pages: 298

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net