How to reduce postfix milter processes?

22 Views Asked by At

I have to configure a project where we run a CentOS gateway which uses a first postfix instance for splitting outgoing emails to single messages per recipient and then this is relaying all locally to a second postfix instance (127.0.0.1:25001) with a milter to process these messages.

The thing is, that we do not want to have more than 2 or 3 milter instances in parallel as it is CPU hungry (encryption / compression etc). I tried

default_destination_concurrency_limit = 3 

on all main.cf files but it still does all messages in parallel.

How can I limit the number of postfix instances running the milter?

Slowing down all messages is no good idea (only one per second), as not all messages get processed by the milter. These should be fast in general (~1500 messages/day).

1

There are 1 best solutions below

0
On BEST ANSWER

I finally found the solution by editing master.cf config file of our splitting instance.

I edited the line starting with smtp like this:

OLD:

smtp      unix  -       -       n       -       -       smtp

NEW:

smtp      unix  -       -       n       -       3       smtp

Followed by

postfix reload

This sets the maxproc value to 3, resulting in a maximum of three messages passing the splitter instance at once (max 3 instances processing messages). By this, we were able to reduce the load on the machine during high usage at the cost of being a bit slower on high message amounts.

Reference: https://www.postfix.org/master.5.html