Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My vServer is old (Plesk 8.6, openSUSE 10.3, Qmail). It will be replaced in a few months, but I need an solution until then.

Since approx. two months sending emails gets slower. If you want to send an email with an email client you have to wait sometimes one ore more minutes. There is a webapp on the same server, which sends ~1000 (process) emails a day via the PHP function mail().

Plesk shows often, that the smtp service isn't running. But the qmail-send process is running an the mails in the mailqueue are send (slow). qmail-send process takes not to mich ressources and top shows a load between 0.4 and 2.

But there is a correlation between other send mails. If qmail has an other mail in the mailqueue (local or remote), the speed will drop down. If the mailqueue is empty PHP mail() needs approx. one second, when there are more mails in the mailqueue mail needs 10-60 seconds. If I call the php script twice, the first mail will be send fast and the second much slower.

In times with high mail traffic the delay increases. It is unimportant if the mails are created from the webapp or from extern mail clients.

I checked the nameserver, the reverse dns and if qmail will be started with the -Rt0 parameter. No certificates are involved. Some mailboxes are 6 gigs large.

I changed no concurrency-settings of qmail, because the problem occurs even if only one mail is in the mailqueue. And the first mail ist slow too, with one second.

There are ~ 200 month old mails in /var/qmail/handlers/spool.

Somebody a clue what is going wrong?

Tested with PHP:

$ php mail.php
Sending mail()
0.63656902313232 seconds
$ php mail.php
Sending mail()
4.7495679855347 seconds

Build/tested with qmail-inject:

h14xxxxx:~ # date; echo to: felix@server.de | /var/qmail/bin/qmail-inject; date
Do 16. Feb 13:24:24 CET 2012
Do 16. Feb 13:24:25 CET 2012
h14xxxxx:~ # date; echo to: felix@server.de | /var/qmail/bin/qmail-inject; date
Do 16. Feb 13:24:26 CET 2012
Do 16. Feb 13:24:28 CET 2012
h14xxxxx:~ # date; echo to: felix@server.de | /var/qmail/bin/qmail-inject; date
Do 16. Feb 13:24:29 CET 2012
Do 16. Feb 13:24:34 CET 2012
h14xxxxx:~ # date; echo to: felix@server.de | /var/qmail/bin/qmail-inject; date
Do 16. Feb 13:24:35 CET 2012
Do 16. Feb 13:24:39 CET 2012
h14xxxxx:~ #

Der passende Auszug aus /usr/local/psa/var/log/maillog

Feb 16 13:24:24 h14xxxxx qmail-queue-handlers[19931]: Handlers Filter before-queue for qmail started ...
Feb 16 13:24:24 h14xxxxx qmail-queue-handlers[19931]: from=root@h14xxxxx.stratoserver.net
Feb 16 13:24:24 h14xxxxx qmail-queue-handlers[19931]: to=felix@server.de
Feb 16 13:24:24 h14xxxxx qmail-queue-handlers[19931]: hook_dir = '/var/qmail//handlers/before-queue'
Feb 16 13:24:24 h14xxxxx qmail-queue-handlers[19931]: recipient[3] = 'felix@server.de'
Feb 16 13:24:24 h14xxxxx qmail-queue-handlers[19931]: handlers dir = '/var/qmail//handlers/before-queue/recipient/felix@server.de'
Feb 16 13:24:25 h14xxxxx qmail-queue-handlers[19931]: starter: submitter[19932] exited normally
Feb 16 13:24:25 h14xxxxx qmail: 1329395065.157427 new msg 9850236
Feb 16 13:24:25 h14xxxxx qmail: 1329395065.157626 info msg 9850236: bytes 230 from <root@h14xxxxx.stratoserver.net> qp 19932 uid 0
Feb 16 13:24:25 h14xxxxx qmail: 1329395065.856861 starting delivery 46: msg 9850236 to local 1-felix@server.de
Feb 16 13:24:25 h14xxxxx qmail: 1329395065.857024 status: local 1/10 remote 0/20
Feb 16 13:24:25 h14xxxxx qmail-local-handlers[19934]: Handlers Filter before-local for qmail started ...
Feb 16 13:24:26 h14xxxxx qmail-queue-handlers[19938]: Handlers Filter before-queue for qmail started ...
Feb 16 13:24:26 h14xxxxx qmail-local-handlers[19934]: from=root@h14xxxxx.stratoserver.net
Feb 16 13:24:26 h14xxxxx qmail-local-handlers[19934]: to=felix@server.de
Feb 16 13:24:26 h14xxxxx qmail-queue-handlers[19938]: from=root@h14xxxxx.stratoserver.net
Feb 16 13:24:26 h14xxxxx qmail: 1329395066.298940 delivery 46: success: did_0+0+2/
Feb 16 13:24:26 h14xxxxx qmail-queue-handlers[19938]: to=felix@server.de
Feb 16 13:24:27 h14xxxxx qmail-queue-handlers[19938]: hook_dir = '/var/qmail//handlers/before-queue'
Feb 16 13:24:27 h14xxxxx qmail: 1329395067.091093 status: local 0/10 remote 0/20
Feb 16 13:24:28 h14xxxxx qmail-queue-handlers[19938]: recipient[3] = 'felix@server.de'
Feb 16 13:24:28 h14xxxxx qmail: 1329395068.363638 end msg 9850236
Feb 16 13:24:28 h14xxxxx qmail-queue-handlers[19938]: handlers dir = '/var/qmail//handlers/before-queue/recipient/felix@server.de'
Feb 16 13:24:28 h14xxxxx qmail-queue-handlers[19938]: starter: submitter[19942] exited normally
Feb 16 13:24:28 h14xxxxx qmail: 1329395068.665296 new msg 9850184
Feb 16 13:24:28 h14xxxxx qmail-local-handlers[19944]: Handlers Filter before-local for qmail started ...
Feb 16 13:24:29 h14xxxxx qmail: 1329395069.473648 info msg 9850184: bytes 230 from <root@h14xxxxx.stratoserver.net> qp 19942 uid 0
Feb 16 13:24:29 h14xxxxx qmail-queue-handlers[19948]: Handlers Filter before-queue for qmail started ...
Feb 16 13:24:29 h14xxxxx qmail-local-handlers[19944]: from=root@h14xxxxx.stratoserver.net
Feb 16 13:24:30 h14xxxxx qmail: 1329395070.264613 starting delivery 47: msg 9850184 to local 1-felix@server.de
Feb 16 13:24:30 h14xxxxx qmail-local-handlers[19944]: to=felix@server.de
Feb 16 13:24:30 h14xxxxx qmail-queue-handlers[19948]: from=root@h14xxxxx.stratoserver.net
Feb 16 13:24:31 h14xxxxx qmail: 1329395071.364589 status: local 1/10 remote 0/20
Feb 16 13:24:32 h14xxxxx qmail-queue-handlers[19948]: to=felix@server.de
Feb 16 13:24:32 h14xxxxx qmail: 1329395072.423865 delivery 47: success: did_0+0+2/
Feb 16 13:24:32 h14xxxxx qmail-queue-handlers[19948]: hook_dir = '/var/qmail//handlers/before-queue'
Feb 16 13:24:33 h14xxxxx qmail: 1329395073.026831 status: local 0/10 remote 0/20
Feb 16 13:24:33 h14xxxxx qmail-queue-handlers[19948]: recipient[3] = 'felix@server.de'
Feb 16 13:24:33 h14xxxxx qmail: 1329395073.401616 end msg 9850184
Feb 16 13:24:33 h14xxxxx qmail-queue-handlers[19948]: handlers dir = '/var/qmail//handlers/before-queue/recipient/felix@server.de'
Feb 16 13:24:34 h14xxxxx qmail-queue-handlers[19948]: starter: submitter[19952] exited normally
Feb 16 13:24:34 h14xxxxx qmail: 1329395074.558677 new msg 9850184
Feb 16 13:24:34 h14xxxxx qmail: 1329395074.773783 info msg 9850184: bytes 230 from <root@h14xxxxx.stratoserver.net> qp 19952 uid 0
Feb 16 13:24:34 h14xxxxx qmail-local-handlers[19954]: Handlers Filter before-local for qmail started ...
Feb 16 13:24:35 h14xxxxx qmail: 1329395075.309948 starting delivery 48: msg 9850184 to local 1-felix@server.de
Feb 16 13:24:35 h14xxxxx qmail-queue-handlers[19958]: Handlers Filter before-queue for qmail started ...
Feb 16 13:24:36 h14xxxxx qmail: 1329395076.330075 status: local 1/10 remote 0/20
Feb 16 13:24:36 h14xxxxx qmail-local-handlers[19954]: from=root@h14xxxxx.stratoserver.net
Feb 16 13:24:37 h14xxxxx qmail-local-handlers[19954]: to=felix@server.de
Feb 16 13:24:37 h14xxxxx qmail-queue-handlers[19958]: from=root@h14xxxxx.stratoserver.net
Feb 16 13:24:37 h14xxxxx qmail: 1329395077.678698 delivery 48: success: did_0+0+2/
Feb 16 13:24:38 h14xxxxx qmail-queue-handlers[19958]: to=felix@server.de
Feb 16 13:24:38 h14xxxxx qmail: 1329395078.009558 status: local 0/10 remote 0/20
Feb 16 13:24:38 h14xxxxx qmail: 1329395078.871718 end msg 9850184
Feb 16 13:24:38 h14xxxxx qmail-queue-handlers[19958]: hook_dir = '/var/qmail//handlers/before-queue'
Feb 16 13:24:38 h14xxxxx qmail-queue-handlers[19958]: recipient[3] = 'felix@server.de'
Feb 16 13:24:39 h14xxxxx qmail-queue-handlers[19958]: handlers dir = '/var/qmail//handlers/before-queue/recipient/felix@server.de'
Feb 16 13:24:39 h14xxxxx qmail: 1329395079.587290 new msg 9850184
Feb 16 13:24:39 h14xxxxx qmail-queue-handlers[19958]: starter: submitter[19962] exited normally
Feb 16 13:24:39 h14xxxxx qmail: 1329395079.697880 info msg 9850184: bytes 230 from <root@h14xxxxx.stratoserver.net> qp 19962 uid 0
Feb 16 13:24:40 h14xxxxx qmail-local-handlers[19964]: Handlers Filter before-local for qmail started ...
Feb 16 13:24:40 h14xxxxx qmail: 1329395080.167264 starting delivery 49: msg 9850184 to local 1-felix@server.de
Feb 16 13:24:41 h14xxxxx qmail: 1329395081.380693 status: local 1/10 remote 0/20
Feb 16 13:24:40 h14xxxxx qmail-local-handlers[19964]: from=root@h14xxxxx.stratoserver.net
Feb 16 13:24:41 h14xxxxx qmail-local-handlers[19964]: to=felix@server.de
Feb 16 13:24:41 h14xxxxx qmail: 1329395081.775765 delivery 49: success: did_0+0+2/
Feb 16 13:24:41 h14xxxxx qmail: 1329395081.775847 status: local 0/10 remote 0/20
Feb 16 13:24:41 h14xxxxx qmail: 1329395081.904212 

/etc/resolv.conf

nameserver 85.214.7.22
nameserver 81.169.163.106

/etc/hosts

127.0.0.1       localhost

# special IPv6 addresses
::1             localhost ipv6-localhost ipv6-loopback

fe00::0         ipv6-localnet

ff00::0         ipv6-mcastprefix
ff02::1         ipv6-allnodes
ff02::2         ipv6-allrouters
ff02::3         ipv6-allhosts

# Auto-generated hostname. Please do not remove this comment.
85.214.xx.xxx h14xxxxx.stratoserver.net h14xxxxx

$nslookup 127.0.0.1

Server:         85.214.7.22
Address:        85.214.7.22#53

Non-authoritative answer:
1.0.0.127.in-addr.arpa  name = localhost.

Authoritative answers can be found from:

$nslookup 85.214.xx.xxx

Server:         85.214.7.22
Address:        85.214.7.22#53

Non-authoritative answer:
163.96.214.85.in-addr.arpa      name = h14xxxxx.stratoserver.net.

Authoritative answers can be found from:

/var/qmail/control/me

h14xxxxx.stratoserver.net

/var/qmail/control/locals

localhost

/etc/xinet.d/smtp_psa

service smtp
{
        socket_type     = stream
        protocol        = tcp
        wait            = no
        disable         = no
        user            = root
        instances       = UNLIMITED
        env             =  SMTPAUTH=1
        server          = /var/qmail/bin/tcp-env
        server_args     = -Rt0  /var/qmail/bin/relaylock /var/qmail/bin/qmail-smtpd /var/qmail/bin/smtp_auth /var/qmail/bin/true /var/qmail/bin/cmd5checkpw /var/qmail/bin/true
}

/etc/xinet.d/smtps_psa

service smtps
{
        socket_type     = stream
        protocol        = tcp
        wait            = no
        disable         = no
        user            = root
        instances       = UNLIMITED
        env             =  SMTPAUTH=1
        server          = /var/qmail/bin/tcp-env
        server_args     = -Rt0  /var/qmail/bin/relaylock /var/qmail/bin/qmail-smtpd /var/qmail/bin/smtp_auth /var/qmail/bin/true /var/qmail/bin/cmd5checkpw /var/qmail/bin/true
}

Top

top - 13:53:29 up 21:53,  2 users,  load average: 0.78, 0.58, 0.42
Tasks:  83 total,   3 running,  80 sleeping,   0 stopped,   0 zombie
Cpu(s):  5.4%us,  2.0%sy,  0.0%ni, 86.7%id,  6.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   6291456k total,   473208k used,  5818248k free,        0k buffers
Swap:        0k total,        0k used,        0k free,        0k cached
share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.