By the way, this patch and the last one that I submitted on the sievec
core dumping problem refer to the released 2.2.8 version of Cyrus.  I did
forget to mention that in the last post...

Anyways, we ran into another problem on Tru64 that we are going to have to
dig deeper and probably call HP on.  Basically, the server wouldn't take
long before it would run out of file descriptors to open new files.  It did
not matter if it was an LMTPD process or one of the IMAPD processes.  When
I check one of the processes, I would see over a hundred open descriptors
for /etc/hosts and over a hundred open descriptors for /etc/ipnodes.

The problem was tracked back to the getnameinfo() function.  Everytime a
new connection was established with one of the Cyrus services, getnameinfo()
would be called to resolve the incoming client to a hostname and IP address.
From what I could tell, the getnameinfo() call would open the /etc/hosts
and /etc/ipnodes files, but neglect to close them.  Since process reuse
themselves after the connection is closed, this can add up... especially
with 2 fd's per connection getting consumed.

Commenting out the getnameinfo() calls that are resolving connections to
hostnames solves the problem.  Keep in mind that not all getnameinfo() calls
were bad, since some of them strictly deal with the IP addresses, meaning
that those calls don't actually do hostname lookups.  I just commented out
the ones that would end up leaking file descriptors.

The final solution that I chose was to actually implement a new imapd.conf
option called "hostname_lookups" that allows the hostname lookups to be
turned off if the admin desires.  It is enabled by default.  This works
great for us.  The biggest reason why I wanted to go this route is for
performance reasons... We have turned off hostname lookups in several of
our applications, as it is just really expensive to be doing DNS lookups
on a super busy system when the only thing it is being used for is for
logging.  Whether or not we fix the Tru64 bug, I will be much happier not
doing hostname lookups :)

The patch is attached...

Scott
--
+-----------------------------------------------------------------------+
     Scott W. Adkins                http://www.cns.ohiou.edu/~sadkins/
  UNIX Systems Engineer                  mailto:[EMAIL PROTECTED]
       ICQ 7626282                 Work (740)593-9478 Fax (740)593-1944
+-----------------------------------------------------------------------+
    PGP Public Key available at http://www.cns.ohiou.edu/~sadkins/pgp/

Attachment: HOSTNAME_LOOKUP.patch
Description: Binary data


Attachment: pgpTIcb8T4Gya.pgp
Description: PGP signature

Reply via email to