On Mon, Jan 07, 2013 at 04:24:20PM -0200, Rafael Azevedo - IAGENTE wrote:

> I've done exactally what you said and notice that the connection
> cache is not being used anymore.

You have enabled cache-on-demand behaviour. This happens when the active
queue contains a "backlog" of messages to the destination. If your
input rate is sufficiently low, messages leave as quickly as they
arrive and connections are not cached.

> I ran a script with loop sending email to few recipients, and
> the cache seems not be working (after commenting
> slow_destination_rate_delay).

This does not generate mail sufficiently fast, it is delivered as
fast as it arrives with no backlog.

> Changing slow_destination_rate_delay to 1s enables postfix cache's
> usage again.

You can set the rate delay to 1s, (but not more), provided 1msg/sec
is above your long-term average message rate to the destination.

If you just want to always cache, in master.cf change the "slow"
entry to add the option:

  master.cf:
    slow unix ... smtp
      -o smtp_connection_cache_destinations=$slow_connection_cache_destinations

and then in main.cf add:

  main.cf:
    # Perhaps safer:
    # slow_connection_cache_destinations = example.com
    slow_connection_cache_destinations = static:all

Or instead of 'static:all' just the nexthop you use in the transport
table for the slow domains in question, that way other nexthops that
use the slow transport can still use demand caching. You can of course
also use a table with appropriate keys:

  main.cf:
    indexed = ${default_database_type}:${config_directory}/
    slow_connection_cache_destinations = ${indexed}cache-nexthops

  cache-nexthops:
    example.com         whatever

Don't forget "postfix reload".

-- 
        Viktor.

Reply via email to