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.
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.
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 sounds like the wrong tool for this job - it will defer
all connections from the client until the rate falls below the
level you specify. If your goal is to force connections to go
to another server in your farm, anvil might work.
If I use this parameter, how can I instruct anvil to reply with 421 and not
any other non-special reply?
Anvil always uses the 421 reply and is not adjustable.
--
Noel Jones