sendmail is slow in linux (18 Views)
Reply
Advisor
hanyyu1
Posts: 40
Registered: ‎11-10-2005
Message 1 of 8 (18 Views)

sendmail is slow in linux

I found the sendmail daemon have problem , if I send the mail to my mail box via sendmail is very slow , and it takes about 5 minutes to stop/start this daemon , ( i think it only need a few seconds to complete it ), could suggest what is wrong ? thx.
Please use plain text.
Respected Contributor
Vipulinux
Posts: 321
Registered: ‎04-19-2005
Message 2 of 8 (18 Views)

Re: sendmail is slow in linux

Sendmail can be slow due to no of reasons: 1 what comes to mind is to check for the DNS Server MX records and see if there is latency out there.

Most sendmail issues seesm to be with name resolution, check your dns.

Cheers
Vipul
Please use plain text.
Honored Contributor
Muthukumar_5
Posts: 4,030
Registered: ‎06-09-2004
Message 3 of 8 (18 Views)

Re: sendmail is slow in linux

May be a problem with hostname resolvation.

check these files and post informations,

a) /etc/nsswitch.conf file for hosts: entry
b) /etc/resolv.conf for dns
c) /etc/hosts

Check connectivity as,

a) nslookup
b) traceroute

to the destination user account mail Id server.

--
Muthu
Easy to suggest when don't know about the problem!
Please use plain text.
Exalted Contributor
Steven E. Protter
Posts: 33,806
Registered: ‎08-15-2002
Message 4 of 8 (18 Views)

Re: sendmail is slow in linux

Shalom,

Its almost always DNS configuration, /etc/nsswitch.conf and more important /etc/resolv.conf that causes this.

It could be the DNS server itself if other machines with similar configurations are affected.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Please use plain text.
Honored Contributor
Stuart Browne
Posts: 3,032
Registered: ‎02-20-2002
Message 5 of 8 (18 Views)

Re: sendmail is slow in linux

The delay stopping/starting the daemon is odd though.

Is this publicly exposed, and do you have a large mail queue? ('mailq -OMaxQueueRunSize=1;mailq -Ac -OMaxQueueRunSize=1' will show you how big the queues are).

Mind you, I've got a machine here with in excess of 20,000 messages in the queue, and sendmail still restarts within 2 seconds.
One long-haired git at your service...
Please use plain text.
Advisor
hanyyu1
Posts: 40
Registered: ‎11-10-2005
Message 6 of 8 (18 Views)

Re: sendmail is slow in linux

thx replies,

yes , it should be the problem of resolve host name , if I add the host name to the /etc/hosts as below, it works perfect . But I concern whether this setting will affect the DNS lookup problem of the system, is there any impact of this setting ? thx

vi /etc/hosts

127.0.0.1 localhost.localdomain localhost my_host_name
Please use plain text.
Honored Contributor
Stuart Browne
Posts: 3,032
Registered: ‎02-20-2002
Message 7 of 8 (18 Views)

Re: sendmail is slow in linux

Generally, if your machine has a static IP address, it's best to add the hostname on the line with the static address.

Recent distributions however have been adding the hostname to the 127.0.0.1 line, and this works alright for most things.

If you are not part of a network where this machine is acting for the mail server, then it's fine. If there are multiple machines using this one as a mail server, it should have a static IP and the hostname should be on a line in /etc/hosts on that line.
One long-haired git at your service...
Please use plain text.
Exalted Contributor
Steven E. Protter
Posts: 33,806
Registered: ‎08-15-2002
Message 8 of 8 (18 Views)

Re: sendmail is slow in linux

How fast your system sends mail to itself is of little relavence, though I know its annoying when you are waiting for it to do something.

If the machine is expected to get mail to other machines, thats when DNS performance matters. So you need to make sure the response of your DNS servers, listed in /etc/resolv.conf is appropriate.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation