On 11/28/2011 1:04 PM, Wietse Venema wrote:
> Alfredo Saldanha:
>> Dear,
>>
>> I'd like to know if is there some way to disable automatic or manually 
>> Postfix filters in case of failure (overload) or something.
>> I'm asking this because I was an incident where, under an overload of 
>> messages, I had problems with my mx performance (very high CPU load and 
>> memory usage) to deliver messages through filters header and body checks 
>> and also a check for a policy server.
>> Somewhere in an overload, some messages were blocked, and would 
>> certainly "whitelisted" the Policy Server, but it was no longer 
>> responding to connections due to high load on the server processes.
>> Then ask them, is possible turn off or divert messages from filters like 
>> cidr (check_client_access), body (body_checks) and header checks in the 
>> event of an overload of messages?
> 
> First of all, you must configure the system such that Postfix can
> handle the load for the configured SMTP server process limit.  If
> the default process limit (100) is too high for your system, reduce
> the number.
> http://www.postfix.org/postconf.5.html#default_process_limit
> 
> You can stress test Postfix performance with the smtp-source utility
> which is included with Postfix source code.
> http://www.postfix.org/smtp-source.1.html
> 
> Postfix has an overload-adaptive mechanism, but you should first
> reduce your process limit until it is small enough that your system
> can handle the load.
> http://www.postfix.org/STRESS_README.html
> 
>       Wietse



Alfredo,

In addition to what Wietse writes, I would encourage you to test
your system to see exactly what is failing under high load.

The check_client_access cidr table is unlikely to add more than a
negligible amount of CPU usage, although a very large table (10's of
thousands entries) might use quite a bit of memory.  Access table
usage will show up in the memory and CPU usage of the smtpd
processes.  Temporarily disable your access tables to measure the
impact on the smtpd processes -- and note that most of the memory
used by smtpd is shared between processes.

header_checks and body_checks likewise should not use much ram or
CPU unless you've configured an unreasonable number of checks.
Remove entries that rarely or never match anything; limit the amount
of data checked with body_checks by setting body_checks_size_limit
to some reasonable number (the default 51200 should be reasonable
for most sites).  These checks are run by the cleanup processes.

Policy servers are a frequent source of performance issues.  Make
sure yours isn't dying or timing out under heavy load.

Finally, if your machine is swapping due to high memory use, either
add RAM or reduce the postfix default_process_limit to manage peak
memory use.



  -- Noel Jones

Reply via email to