Docsity

Tuning Postfix for performance, Summaries of Computer Science

Toggle sidebar
bg1
POSTFIX PERFORMANCE TUNING
The goal of Postfix performance tuning is to improve the efficiency and throughput
of an already functional Postfix system. This document outlines strategies for mail
receiving, delivery, resource management, and operating system-level optimizations.
Note: Performance tuning is for working systems. If your Postfix cannot receive or
deliver mail, resolve those issues first using the DEBUG_README guide.
1. Mail Receiving Performance
Improving the rate at which Postfix accepts mail involves reducing latency and
optimizing process management.
General Tips
Local Name Server: Run a local DNS resolver to eliminate network latency for
lookups.
LDAP Optimization: Use domain filters to avoid unnecessary lookups for
remote domains.
Disable Unnecessary Checks: If performance is lagging, temporarily disable
header_checks or body_checks to identify if patterns are causing
bottlenecks.
SMTP Server Throttling
Postfix uses "tar pitting" to slow down clients that make errors, but these delays
consume server processes. In high-volume environments, you can minimize these
delays:
A Technical Guide for High-Performance Mail Systems
•
•
•
Page 1 of 5
pf3
pf4
pf5

Partial preview of the text

Download Tuning Postfix for performance and more Summaries Computer Science in PDF only on Docsity!

POSTFIX PERFORMANCE TUNING

The goal of Postfix performance tuning is to improve the efficiency and throughput of an already functional Postfix system. This document outlines strategies for mail receiving, delivery, resource management, and operating system-level optimizations.

Note: Performance tuning is for working systems. If your Postfix cannot receive or deliver mail, resolve those issues first using the DEBUG_README guide.

1. Mail Receiving Performance

Improving the rate at which Postfix accepts mail involves reducing latency and optimizing process management.

General Tips

Local Name Server: Run a local DNS resolver to eliminate network latency for lookups. LDAP Optimization: Use domain filters to avoid unnecessary lookups for remote domains. Disable Unnecessary Checks: If performance is lagging, temporarily disable header_checks or body_checks to identify if patterns are causing bottlenecks.

SMTP Server Throttling

Postfix uses "tar pitting" to slow down clients that make errors, but these delays consume server processes. In high-volume environments, you can minimize these delays:

A Technical Guide for High-Performance Mail Systems

Reduce sleep time for errors (Postfix 2.0 and earlier)

smtpd_error_sleep_time = 0

Client Connection & Rate Limits

Managed by the anvil service, these limits protect against abuse:

Parameter Default Description

smtpd_client_connection_count_limit 50 Max simultaneous connections per client IP.

smtpd_client_connection_rate_limit no limit

Max connections in a time interval (anvil_rate_time_unit).

smtpd_client_message_rate_limit no limit

Max messages in a time interval.

2. Mail Delivery Performance

Optimizing how Postfix sends mail focuses on parallelization and timeout management.

Improving Throughput

Submit via SMTP: Use SMTP for local submission instead of /usr/sbin/ sendmail for better scalability. Batch Recipients: Submit messages with multiple recipients rather than individual emails per recipient. Reduced Timeouts: Lower smtp_connect_timeout and smtp_helo_timeout to avoid wasting time on unresponsive servers.

Concurrency Tuning

Postfix uses a "slow start" strategy for delivery concurrency to avoid the thundering herd problem.

Process Limits

The default_process_limit (default: 100) applies to SMTP clients, servers, and other daemons. You can override this globally in main.cf or per-service in master.cf.

main.cf

default_process_limit = 50

master.cf (limiting only SMTP server)

service type private unpriv chroot wakeup maxproc command

smtp inet n - - - 20 smtpd

5. Operating System Tuning

High-performance mail servers often require kernel-level adjustments to support many open files and processes.

Linux Tuning

Increase file descriptors and thread limits

fs.file-max = 16384 kernel.threads-max = 2048

FreeBSD Tuning

kern.ipc.maxsockets = "5000" kern.maxfiles = "16384"

Solaris Tuning

set rlim_fd_max = 4096 set rlim_fd_cur = 1024

  • Source: Postfix Official Documentation (https://www.postfix.org/TUNING_README.html) | Generated on May