[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multiple transport agents for the same thread?

> Hi,
> 	It looks absolutely impossible to allow to run more than
> one agent per thread. What would it take to allow a number of smtp
> agents to deliver mail to a particular host simultaneously?

	It would take radical redesign of the thread processing
	algorithm.  One of the reasons for it being made in the
	current way is my utter displeasure on the approach used
	at qmail -- qmail sends each message in separate sessions,
	and if there happen to be multiple messages sendable, it
	sends them all with parallel SMTP streams.

	With such approach you may gain something over the LAN,
	but you will definitely hurt yourself over slow/long WANs.

	If you have a slow link with lengthy time in between issueing
	a SMTP protocol line, and getting it acknowledged, you can
	speed things up by using PIPELINING facility.  (RFC 1854)

	That is the way I use to feed oodles of recipients from
	vger.rutgers.edu Linux lists to relay server at nic.funet.fi.
	The ping time in between is 115-130 ms which on loaded
	systems rather easily yields only 2-3 recipient addresses
	per second. (Max 7 per second.)

	Using pipelining, sender sends all MAIL FROM:<..> and RCPT TO:<..>
	statements up to "DATA" statement all in one throw, and then
	starts to analyze the responses it collected into some auxiliary
	buffer during the writing phase..  (That is how I did it, but
	you can analyze also when the report is read during the write
	phase.)  Maximum speed ? Presume 64 kbs connection, 80 chars
	for each address entry, and IP+TCP+HDLC overhead factor of 20%:
	About 6.6 kB/sec down the stream, alias 83 addresses per second.

	Ultimately delay-bandwidth product on the wire will top at 64 kB
	for each round-trip, as the TCP can't have more data outstanding.
	(There are ways to overcome that, but lets not dwell in it.) 
	On 130 ms roundtrip the limit translates to 0.5 MB/sec or 6300
	addresses per second.  (Usually the socket buffers are smaller
	than 64 kbps, and it means lower maximum throughput.)

> 							alexis
> -- 
> 			Where the wild horses run

/Matti Aarnio <mea@nic.funet.fi>