Docsity

POSTFIX QUEUE BOTTLENECK ANALYSIS, Summaries of Computer Science

Toggle sidebar
bg1
POSTFIX QUEUE BOTTLENECK ANALYSIS
When mail delivery slows down or queue sizes balloon unexpectedly, the qshape tool provides a vital tabular
view of Postfix queue contents, categorized by destination domain and message age. This guide explores how to
interpret these metrics to identify system bottlenecks.
1. Understanding the Postfix Queues
To analyze performance, you must understand where a message lives within the Postfix lifecycle:
Queue Purpose Congestion Signifies
maildrop Local submissions (postdrop). Excessive local submission rate or slow cleanup processes.
hold Messages diverted for inspection. Manual intervention required; little role in automated performance.
incoming New mail awaiting processing. qmgr falling behind or disk I/O starvation.
active Mail ready for delivery attempt. Saturation (limit: 20k). One or more destinations are slow/draining.
deferred Mail that failed previous attempts. Temporary network/host failures. Harmless if not saturating active.
2. Introducing the qshape Tool
qshape displays the distribution of messages in the queue. The horizontal axis represents queue age in minutes,
and the vertical axis lists destination domains.
# Typical syntax:
qshape [queue_name]
qshape -s [queue_name] # View by Sender instead of Recipient
Interpreting the Output
$ qshape deferred | head T 5 10 20 40 80 160 320 640 1280 1280+ TOTAL 2234 4 2 5 9 31 57 108 201
464 1353 yahoo.com 207 0 0 1 1 6 6 8 25 68 92 hotmail.com 46 0 0 0 0 1 0 2 6 12 25
In this example, yahoo.com has 207 messages in the deferred queue. The distribution shows that the majority
(92) are older than 1280 minutes (approx. 1 day), suggesting a long-term delivery issue rather than a recent burst.
Utilizing the qshape tool for real-time congestion troubleshooting
Page 1 of 2
pf2

Partial preview of the text

Download POSTFIX QUEUE BOTTLENECK ANALYSIS and more Summaries Computer Science in PDF only on Docsity!

POSTFIX QUEUE BOTTLENECK ANALYSIS

When mail delivery slows down or queue sizes balloon unexpectedly, the qshape tool provides a vital tabular

view of Postfix queue contents, categorized by destination domain and message age. This guide explores how to

interpret these metrics to identify system bottlenecks.

1. Understanding the Postfix Queues

To analyze performance, you must understand where a message lives within the Postfix lifecycle:

Queue Purpose Congestion Signifies

maildrop Local submissions (postdrop). Excessive local submission rate or slow cleanup processes.

hold Messages diverted for inspection. Manual intervention required; little role in automated performance.

incoming New mail awaiting processing. qmgr falling behind or disk I/O starvation.

active Mail ready for delivery attempt. Saturation (limit: 20k). One or more destinations are slow/draining.

deferred Mail that failed previous attempts. Temporary network/host failures. Harmless if not saturating active.

2. Introducing the qshape Tool

qshape displays the distribution of messages in the queue. The horizontal axis represents queue age in minutes,

and the vertical axis lists destination domains.

# Typical syntax:

qshape [queue_name]

qshape -s [queue_name] # View by Sender instead of Recipient

Interpreting the Output

$ qshape deferred | head T 5 10 20 40 80 160 320 640 1280 1280+ TOTAL 2234 4 2 5 9 31 57 108 201 464 1353 yahoo.com 207 0 0 1 1 6 6 8 25 68 92 hotmail.com 46 0 0 0 0 1 0 2 6 12 25

In this example, yahoo.com has 207 messages in the deferred queue. The distribution shows that the majority

(92) are older than 1280 minutes (approx. 1 day), suggesting a long-term delivery issue rather than a recent burst.

Utilizing the qshape tool for real-time congestion troubleshooting

Page 1 of 2

3. Troubleshooting Common Scenarios

Scenario A: Healthy System

In a healthy system, the incoming and active queues should be nearly empty. Mail should flow through almost

instantly.

Check: Run qshape (default is incoming + active). If the TOTAL is low (under 100), the system is performing

optimally.

Scenario B: Active Queue Saturation

The active queue has a hard limit (default: 20,000 messages). When full, qmgr stops importing new mail from

incoming.

Action: If qshape active shows 20,000 messages, identify the top destination. If one domain dominates, that

destination is "clogging" your delivery agents. Use tail -f /var/log/maillog | grep [domain] to see if

connections are timing out.

Scenario C: High-Volume Backlog

If a remote site goes down, mail accumulates in deferred. This is generally harmless unless the volume is so

high it slows down queue scanning.

4. Advanced: Handling "Fragile" Destinations

Some servers (like older Microsoft Exchange versions) refuse connections under load with 421 errors. Postfix

might mark them "dead" too quickly. For Postfix 2.5+, you can clone a transport to handle these specifically:

# main.cf

fragile_destination_concurrency_failed_cohort_limit = 100

fragile_destination_concurrency_limit = 20

# transport

example.com fragile:

# master.cf

fragile unix - - n - 20 smtp

This allows up to 100 consecutive errors before marking the site "dead," while keeping the total number of

processes low (20).

Source: Postfix Official Documentation (https://www.postfix.org/QSHAPE_README.html) | Technical Reference

Page 2 of 2