Re: Name resolution limits
Re: Name resolution limits
- Subject: Re: Name resolution limits
- From: Glenn Anderson <email@hidden>
- Date: Fri, 8 Feb 2002 17:53:55 +1300
On 2/7/02 5:53 PM, "Josh Graessley" <email@hidden> wrote:
This is not a problem with Mac OS Xs networking, this is a problem with the
design of the APIs used to lookup names. The APIs are written for a world
where you simply block to wait for an operation to complete.
Hmm., which to someone like me (who's customers are pressuring me to release
an OSX version of my mail server that has better performance than the OS9
version) sounds like it is a problem with OSX networking.
Assuming I am looking at the right code, res_send.c, it fundamentally
can not do multiple queries at the same time in the same application,
it will need rewritten to do so. It is definitely a problem with OS X
networking.
The short answer appears to be:
Cache more aggressively and rewrite my code so that I don't get as many name
lookup timeouts.
One more question, since there can only be one of these at a time, how long
does it take for OTInetMailExchange() and OTInetStringToAddress() to
timeout?
On Mac OS 9, it seems to be something like 15 seconds for each name
server. Just looking through the OS X resolver code, it looks like it
takes about 65 seconds. You could change that by modifying the
globals _res.retrans and _res.retry, _res.retry is the number of
retries which defaults to 4, _res.retrans is the retransmission
interval which defaults to 5. res_send(), the procedure that does the
sending of the lookup and receiving of the reply, uses this algorithm:
for (try = 0; try < _res.retry; try++) {
for (ns = 0; ns < _res.nscount; ns++) {
<snip>
/*
* Wait for reply
*/
timeout.tv_sec = (_res.retrans << try);
if (try > 0)
timeout.tv_sec /= _res.nscount;
if ((long) timeout.tv_sec <= 0)
timeout.tv_sec = 1;
timeout.tv_usec = 0;
<snip>
}
}
All of this adds up to real bad news for mail servers, or am I missing
something?
It is bad news for mail servers that want to be fast and efficient by
being threaded. Clunky old unix mail servers that have one process
per connection don't have this problem.
Glenn.
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.