Knowledge base

PMTA knowledge base›Block <domain>›Directive§ 3.3.10.14

queue-priority

<domain>

The priority of this queue when competing for connections
in the configuration this is a linequeue-priority 50inside the block <domain>
Who interrupts whom when there are not enough connections

The default is 50, exactly the middle of the scale.

It works like this: the engine needs to deliver a queue’s messages, and there are no free connections. Then it looks for a connected queue with a lower priority and interrupts as many of its connections as needed — starting with the lowest-priority ones and moving up.

That is, the number decides not “whom to serve first” in general, but whose connection can be taken away when there are not enough of them.

The scale: the directive’s section gives the range from 0 (lowest) to 100 (highest); the section on priorities gives from 1 to 100. The discrepancy is one value.

The same line used to have a different name: delivery-priority has been declared obsolete in favor of this one.

The main trap is that priority shows up only under shortage. While there are enough free connections for everyone, the number does nothing: nobody takes anything from anyone. Having set priorities on a quiet node and seen no difference, it is easy to decide the line does not work.

The other half is that interruption is not free. A taken connection is interrupted work: the receiver sees a disconnect, and reconnecting costs time on both your side and theirs. Frequent priority reshuffles on a loaded node produce more disconnects than benefit.

What the Hub does. It does not write it — all queues stay at the vendor’s fifty, that is, equal.

The Hub separates urgent and bulk mail differently: with separate sending addresses. Warm-up has its own stream with its own limits, the mailing has its own — they do not compete for the same connections and therefore do not need priorities.

Recommended values

What to set. The numbers make sense only relative to each other:

Value When
50 (default) ordinary mail — all queues are equal
above 50 a direction that must not wait: confirmations, password resets
below 50 a bulk mailing that can give way

Spread them noticeably, not by single units: the difference between 50 and 55 gives nothing meaningful, while between 25 and 75 it does. And remember not to use zero: the manual speaks about it with two voices.

The 50 default, the bottom-up interruption rule and the range from zero come from the manual, § 3.3.10.14. The range from one is from § 11.9.1. The advice to spread them noticeably is ours.
Example configuration
# confirmations should not wait behind a mailing
<domain someplace.com>
    queue-priority 75</domain>

<virtual-mta newsletter>
    <domain someplaceelse.com>
        queue-priority 30
    </domain>
</virtual-mta>
A priority can also be set inside a sending stream — then it applies only to the queue that goes through that stream.
yellow — — directive names, blue — blocks. They are highlighted the same way in the text of the card.
▲

Common mistakes and problems

what people get wrong and how it ends3 mistakes▶

Testing priorities on a quiet node

§ 3.3.10.14

What it costsWhile there are enough connections for everyone, priority does nothing. The setting looks broken, and people start changing it at random.
How to spot itPriorities are set, and queue behavior has not changed.
How to do it rightTest under a load close to the overall ceiling of outgoing connections.

Spreading priorities by single units

our experience

What it costsThe difference between 50 and 55 gives no meaningful order: interruption still starts with the lowest, and a five-unit gap changes nothing.
How to spot itPriorities are set, but the order in which queues are served is the same.
How to do it rightSpread them noticeably — for example 25, 50, 75.

Forgetting that interruption breaks the connection

our experience

What it costsA taken connection is interrupted work. The receiver sees a disconnect, reconnecting costs both sides time, and frequent reshuffles produce more disconnects than benefit.
How to spot itThe number of connections to receivers grows, delivery does not speed up.
How to do it rightSpread priorities rarely and coarsely rather than tuning them constantly.
Compatibility
PowerMTA 6.0
described in the manual of this version · platform: any
The vendor does not state the first version for every directive — there is no note here. The name also appears in the 5.0 edition of the manual.
Reference data
Syntax
queue-priority <integer>
Values
an integer from 0 to 100; the section on priorities gives the range from 1
Default
50 § 3.3.10.14
Applying
reload, no restart needed
Queue
will not touch what is already queued
Where to write it
<domain>
How many times
once in the block
Everything here comes from the manual, with the section.
Inheritance
The directive lives in <domain> and follows recipient block merging: a narrower block overrides a broader one. It can also be set inside a sending stream — then it is about the queue “this domain through this stream,” not about the domain in general.
How to check on the node
Priorities are visible in the configuration, the effect in the queue state:
grep -n 'queue-priority' /etc/pmta/config /etc/pmta/virtualhost.txt
pmta show queues --connected=yes --maxitems=20
The difference shows up only when connections run short. On a quiet node both queues get as many as they need, and the priority shows up in no way.
In the Hub
Cost of a mistake
reversible: harms only while it is set
Scenarios
Tune the pace for a provider