OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Subject: Re: Some questions on postfix, SUMMARY
From: Craig Sanders (castaz.net.au)
Date: Fri Mar 03 2000 - 19:09:41 CST


On Thu, Mar 02, 2000 at 04:31:45PM -0500, Karimov, Rashid (NBC, CNBC) wrote:

> A. The fastest/easiest way to generate the messages (see the original
> post) is to use SMTP to inject messages into postfix and let it handle the
> rest.
> [....]
>
> Possible problems:
>
> 1. Too many recepients and long enough messages can potentially lead
> to many (and I mean many!) threads/processes doing SMTP at the
> same time into a single (having a few would help) postfix relay.
> One might even have to throttle .

this isn't such a great problem if you have multiple postfix relay boxes
sitting behind a load-balancer - e.g. a cisco LocalDirector or ACE
Director.

alternatively, if you'd rather not spend $20,000 to do what a $500 linux
box can do better then use an old pentium with the LVS (Linux Virtual
Server) kernel patch. you may even have an old pentium gathering dust
which can be used for this job - it doesn't need to be a fast machine,
as all it's going to be doing is routing packets.

see http://www.linuxvirtualserver.org/ for details.

you're better off with multiple cheap postfix boxes rather than one big
expensive box....the bottleneck is disk I/O, so you want to spread the
I/O load over as many systems as possible. CPU speed isn't terribly
important, so you could use, say, 3 or more Celeron boxes with nice fast
drives and plenty of RAM for disk buffering. say around $1000-$1500
each new (and that's in Australian dollars...would be sub-$1000 in US
dollars).

think of it as RAMR (Redundant Array of Mail Relays), analogous to RAID
for drives :)

BTW, it would probably be a good idea to use reiserfs rather than ext2fs
for the postfix mail queue on the relay boxes.

this is also highly scalable. if the load is getting too much for three
machines then add another...and another...and another.

> 2. If the SMTP server (postfix(es) you're realying to) are down, you
> wouldn't be able to generate the messages (there is no way
> to spool them, unless you code for it).

again, with "RAMR" as described above the load-balancing box can be
configured to automatically detect when one or more of the mail relays
is dead and simply stop forwarding packets to it.

all your smtp-sender code needs to do is detect whether the message was
accepted by a postfix relay or not (i.e. did it get a final "250 OK"
message?). if not, then close the smtp connection and send it again.
the load balancer will automatically direct the connection to the next
available postfix relay.

(you'll also have to handle the exceptional case of all relay boxes
dying at the same time - power failure or somebody tripping over the
network cable perhaps)

using the heartbeat and ip takeover software for linux, you can
even have a backup load-balancer...so if the LB dies, another one
automatically takes over. at the cost of another <$500 (possibly free)
pentium.

one more comment: you could do something similar with one big mail relay
box with lots of RAID drives (i.e. spread the I/O load over multiple
spindles) but that leaves you with an undesirable single point of
failure...and it's more expensive to replace one monster mail server
than it is to replace little cheap ones.

craig

--
craig sanders