LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   qmail smtp hang / stop working a few times everyday (https://www.linuxquestions.org/questions/linux-server-73/qmail-smtp-hang-stop-working-a-few-times-everyday-596556/)

icechong 11-02-2007 04:10 AM

qmail smtp hang / stop working a few times everyday
 
Hi there,

I am having a qmail server with fedora 6 running for few months already. Basically the installation steps are majority follow qmailrocks guides. After few months using the qmail server, i have noticed a problem here.

My SMTP hang a few times a day, each time for about 10-15 minutes. When it hangs, the users are unable to send mail. When i do qmailctl pause and then qmailctl cont, sometime it can bring up the server.

Here is my qmail-smtp/run. can anyone help me on this?

#!/bin/sh
QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl"; export QMAILQUEUE

QMAILDUID=`id -u vpopmail`
NOFILESGID=`id -g vpopmail`
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
LOCAL=`head -1 /var/qmail/control/me`
if [ -z "$QMAILDUID" -o -z "$NOFILESGID" -o -z "$MAXSMTPD" -o -z "$LOCAL" ]; then
echo QMAILDUID, NOFILESGID, MAXSMTPD, or LOCAL is unset in
echo /var/qmail/supervise/qmail-smtpd/run
exit 1
fi
if [ ! -f /var/qmail/control/rcpthosts ]; then
echo "No /var/qmail/control/rcpthosts!"
echo "Refusing to start SMTP listener because it'll create an open relay"
exit 1
fi
exec /usr/local/bin/softlimit -m 40000000 \
/usr/local/bin/envdir /etc/relay-ctrl /usr/local/bin/relay-ctrl-chdir \
/usr/local/bin/tcpserver -H -P -v -R -l "$LOCAL" -x /etc/tcp.smtp.cdb -c "$MAXSMTPD" \
-u "$QMAILDUID" -g "$NOFILESGID" 0 smtp \
/usr/local/bin/relay-ctrl-check \
/var/qmail/bin/qmail-smtpd etv.com.my \
/home/vpopmail/bin/vchkpw /usr/bin/true 2>&1


thanks.

ghostdancer 11-02-2007 04:36 AM

Since it hanged during run time, this mean, there is some problem with run time (not setup). Can you check the current file for both qmail-smtpd, there maybe some messages for us to get a clue what had happened.?

icechong 11-04-2007 08:47 AM

Quote:

Originally Posted by ghostdancer (Post 2945483)
Since it hanged during run time, this mean, there is some problem with run time (not setup). Can you check the current file for both qmail-smtpd, there maybe some messages for us to get a clue what had happened.?

the current file looks ok, but it stops taking in new log during the hang time, because the smtp not running.

thanks.

icechong 11-05-2007 07:41 PM

if i do qmailstat restart, this will bring back the service until the next "hang", in 3-4 hours time.

mangesh.dhamale 09-30-2011 12:33 AM

i am facing the same problem, in every 10 min i need to restart qmail server.
Please suggest.

roberto967 10-01-2011 07:49 AM

Quote:

Originally Posted by icechong (Post 2945468)
/usr/local/bin/envdir /etc/relay-ctrl /usr/local/bin/relay-ctrl-chdir \

did you try to do a test without pop before smtp?

ShanxT 10-01-2011 01:24 PM

It could be due to lack of memory. To confirm, comment out the 'QMAILQUEUE' line in the qmail-smtpd run file,(just add a '#' before it), and restart qmail. See if it still hangs after doing this.

Edit: Please be aware that this will stop your emails from being scanned for viruses and spam, so only do this for troubleshooting purposes (ie, not for a very long time)

mangesh.dhamale 10-03-2011 01:27 AM

Thank you for your reply;

# free -m
total used free shared buffers cached
Mem: 2006 1974 31 0 81 1203
-/+ buffers/cache: 690 1316
Swap: 4996 0 4995
#

Yes, may be its due to lack of memory. But when i tring to find out where my server memory use.
I got following output.

Tasks: 163 total, 1 running, 161 sleeping, 0 stopped, 1 zombie
Cpu(s): 0.0% us, 0.2% sy, 0.0% ni, 98.8% id, 1.1% wa, 0.0% hi, 0.0% si
Mem: 2055144k total, 2025368k used, 29776k free, 84064k buffers
Swap: 5116692k total, 824k used, 5115868k free, 1220876k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3480 spamd 15 0 139m 60m 3340 S 0.0 3.0 0:25.44 spamd
4056 spamd 16 0 136m 57m 3348 S 0.0 2.9 0:15.06 spamd
24990 apache 16 0 258m 49m 12m S 0.0 2.5 0:11.91 httpd
24993 apache 16 0 258m 49m 12m S 0.0 2.5 0:15.13 httpd
24989 apache 16 0 258m 49m 12m S 0.0 2.5 0:19.90 httpd
24986 apache 16 0 258m 49m 12m S 0.0 2.5 0:20.04 httpd
24994 apache 15 0 258m 49m 12m S 0.0 2.5 0:18.76 httpd
24988 apache 16 0 258m 48m 12m S 0.0 2.4 0:08.97 httpd
24987 apache 16 0 258m 48m 12m S 0.0 2.4 0:16.27 httpd
1976 root 16 0 121m 47m 2704 S 0.0 2.4 0:03.30 spamd
17096 apache 15 0 256m 47m 12m S 0.0 2.4 0:08.72 httpd
17120 apache 16 0 256m 47m 12m S 0.0 2.4 0:17.61 httpd
27428 apache 15 0 256m 47m 12m S 0.0 2.3 0:14.13 httpd
24992 apache 15 0 254m 45m 12m S 0.0 2.3 0:12.65 httpd
1954 mysql 16 0 152m 24m 4120 S 0.0 1.2 0:01.89 mysqld
1985 root 16 0 180m 19m 10m S 0.0 0.9 0:01.20 httpd
1704 named 17 0 97696 12m 2888 S 0.0 0.6 28:34.48 named
4857 qscand 16 0 28576 8016 1984 S 0.0 0.4 0:00.11 perl5.8.6
1860 ntp 16 0 18556 7520 6196 S 0.0 0.4 0:00.38 ntpd
27739 mangesh. 16 0 46608 3724 2868 S 0.0 0.2 0:00.19 sshd
27714 root 16 0 46608 3652 2796 S 0.0 0.2 0:00.01 sshd
27779 root 15 0 92072 3084 2336 S 0.0 0.2 0:00.01 su
2023 root 16 0 33080 2396 1852 S 0.0 0.1 0:01.75 authdaemond
2019 root 16 0 33080 2392 1852 S 0.0 0.1 0:01.82 authdaemond
2020 root 16 0 33080 2392 1852 S 0.0 0.1 0:01.80 authdaemond
2021 root 15 0 33080 2392 1852 S 0.0 0.1 0:01.69 authdaemond
2022 root 16 0 33080 2392 1852 S 0.0 0.1 0:01.62 authdaemond
2745 mangesh. 16 0 16700 2372 1356 S 0.0 0.1 0:02.45 imapd
27740 mangesh. 16 0 60900 2360 1760 S 0.0 0.1 0:00.02 bash
976 root 18 0 4324 2148 748 S 0.0 0.1 0:00.00 kmodule
1840 root 16 0 23104 2116 1664 S 0.0 0.1 0:00.04 sshd
5159 root 16 0 14272 1896 1352 R 0.7 0.1 0:00.07 top

ShanxT 10-05-2011 08:04 AM

Most of your memory is being used by the SpamAssassin daemon (spamd), and Apache (httpd). Are you running a separate site as well on the same server? There's also no 'clamd' (ClamAV's daemon) entry. I'm guessing that only pops up when there is an email to scan. If that is indeed the case, then there's definitely no ram for it to run, as in my experience the clamd process takes up quite a bit of memory as well.

So please try commenting out the 'QMAILQUEUE' line, as I mentioned in my previous post, and see if it helps. After commenting the line, restart qmail and stop (kill if necessary) the SpamAssassin and ClamAV processes. If it does help, then there's definitely a memory issue, and I don't think you can do much other than increase the RAM on the system.

Also, I noticed that you have a zombie process running. You can try stopping that by following the instructions on this site.


All times are GMT -5. The time now is 06:15 AM.