On Mon, Nov 17, 2008 at 05:58:16PM +0100, Diego Castillo wrote:

> Noel, Wietse, Victor,
> 
> Thanks for your replies. Here goes the description of my problem:
> 
> I have a pool of postfix servers receiving SMTP traffic from an upstream MTA
> via a load-balancer. Both the MTA and the LB are out of my control; the MTA
> may not be a postfix, and the LB may not be using a "least-connection"
> strategy.
> 
> The LB should balance messages coming from the MTA, but it is actually
> balancing new connections only. The MTA is opening very few simultaneous
> connections, and reusing each of them for thousands of messages. As a
> result, only a subset of my pool is actually working, each of them with one
> connection being intensively reused.

Define "very few" and "intensively". From what you describe, the sending
MTA has no mail backlog, and is able to deliver mail to you over a small
number of cached connections. This suggests the load is light, in which
case, uneven distribution should not be a problem.

If the upstream MTA were Postfix, it would only cache connections when
the backlog is high enough, and in that case you would typically see
multiple cached connections. Perhaps your upstream is an Exim system,
Exim tries to batch all mail to a site down a single cached connection.

> In order to improve this situation, I want to close the connection at the
> server side from time to time, thus forcing the MTA to open a new connection
> for the next message to come. The new connection will be balanced and may be
> opened against a new postfix server of the pool, which otherwise may remain
> unused for hours.

Is it really necessary to force even distribution? It sounds like you have
sufficient capacity, and the desire for fair loading is somewhat "cosmetic".

> So my understanding is that I need to launch anvil at each server of the
> pool, and make it reply 421 from time to time to its local smptd, so that
> this smtpd will disconnect from its client (the MTA). However, there is no
> way to force this 421 reply at anvil based on total connection duration or
> total number of transactions. The existing parameter that may be close to
> what I'm looking for could be
> [http://www.postfix.org/postconf.5.html#smtpd_client_message_rate_limit],
> which is rate-based.

Anvil will not do what you want, it will respond to "MAIL FROM", not "RSET"
and imposes message rate limits, not per-connection count limits.

> If I use this parameter, how can I instruct anvil to reply with 421 and not
> any other non-special reply?

Anvil always replies with "421".

> At what point of the SMTP transaction will the disconnection happen, after
> acknowledgement of a DATA command?
> 
> The SMTP client may not be sending any RSET command at all, just thousands
> of MAIL-RCPT-DATA series...

Are you sure about that? It really should be sending "RSET" to test the
"liveness" of the cached connection. While it may be legal to skip RSET,
it is not wise, and I would hope that your upstream MTAs does not do that.

-- 
        Viktor.

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.

To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
<mailto:[EMAIL PROTECTED]>

If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.

Reply via email to