> Charles Cazabon <[EMAIL PROTECTED]>
>> D Rajesh <[EMAIL PROTECTED]> wrote:

DR> > If in the total 20,000 mails, say 5000 are hotmail, 5000 are yahoo and
the
DR> > rest are to other domains. Then, is it possible to open a single
DR> > qmail-remote process and dump all messages to be sent to hotmail on
one
DR> > connection and open another connection for all yahoo messages ????

CC> qmail is designed specifically _not_ to do this.  sendmail does this.

DR> > I guess this speeds up the mail delivery amazingly !!!!

CC> No, it slows it down tremendously.  That's why qmail doesn't do it.


* From Rodney:

I haven't tested qmail against sendmail, infact I've barely even used qmail.
But I have done a bit of network programming, so let me open a few points
for consideration:


===> If you send a single messager to a given domain, then the activity on
your side should look something like this:

- Lookup recipient domain.
  This requires getting the current MX for the recipient.
- Open a socket to the mail server for the recipient domain (connect).
- Tell the recipient mail server who you are. (trivial, but existant)
- Send the mail (headers and body)
- Close the socket connection.

According to the input from Charles, qmail repeats this entire process for
EVERY message sent to a given domain.


===> If you handle a bunch of mail to this same domain with a single
connection (we'll assume for the moment that the body is the same for each
message), then the activity on your side should look something like this:

- Lookup recipient domain.
  This requires getting the current MX for the recipient.
- Open a socket to the mail server for the recipient domain (connect).
- Tell the recipient mail server who you are. (trivial, but existant)
- Send the mail (headers, a potentially really long recipient list, and
body)
- Close the socket connection.

Hmm, only one copy of the body got sent to 5000 recipients. Let's see, 5000
times 1K... Hey, that's 5 megabytes!


===> OK, to be fair I'll include the example of sending a bunch of mail to
this same domain with a single connection but with differing message bodies.


- Lookup recipient domain.
  This requires getting the current MX for the recipient.
- Open a socket to the mail server for the recipient domain (connect).
- Tell the recipient mail server who you are. (trivial, but existant)
- For each message:
  * Send the mail (headers and body)
- Close the socket connection.

See, we've missed 5000 name lookups and socket connections. I'll admit that
a decent name server helps this. Also, that creating a socket isn't very
expensive on today's hardware, but it's at least a little bit of the load.
What will become expensive is establishing the actuall connection with the
remote machine (which happens after the socket is created and before data is
sent).


Something else to consider is manually sending all of the messages from your
program. Not too tough, in Perl you'd just use Net::SMTP, do the afore
mentioned name lookup (I use Net::DNS for this), get a connection to that
server, send your messages, then close that connection. The reason for doing
it this way is mostly to save on the total number of processes spawned on
your machine. The importance of this will depend heavily on the power and
load level of your system.


===> So, after all of that, here's my suggestion to you Mr/Ms Rajesh (dunno
which, you didn't give your first name):

If you haven't already done so, install sendmail. You don't need to
configure it to receive, which means that it won't conflict with your
running qmail. Then, use sendmail for your MUA. Make sure that you have
sendmail's queue set up to a long enough time to let your program transfer
all of the messages into sendmail. I would guess that 10 minutes would be
plenty for 20000 messages at a stroke. That way when sendmail wakes up and
goes to sending mail, he'll handle tasks like grouping messages and sending
with fewer connections.


If you acutally do these tests, please let us know what happens. I'm very
interested in hearing input on performance from an impartial person. That
is; not partial to qmail or sendmail. (I'm slowly putting aside my sendmail
bias. ;-) )

---
Rodney Broom
Programmer: Desert.Net



Reply via email to