Qmail:第一封邮件慢(1-2秒),邮件越来越慢(4-60秒)

我的vServer是旧的(Plesk 8.6,openSUSE 10.3,Qmail)。 它会在几个月内被replace,但我需要一个解决scheme,直到那时。

由于约。 两个月发送电子邮件变得更慢。 如果您想用电子邮件客户端发送电子邮件,则必须等待一分钟或更多时间。 在同一台服务器上有一个web应用程序,每天通过PHP函数mail()发送〜1000(进程)电子邮件。

Plesk经常演示,smtp服务没有运行。 但是qmail-send进程正在运行一个邮件队列中的邮件被发送(慢)。 qmail-send进程不需要这些资源,top显示一个介于0.4和2之间的负载。

但其他发送邮件之间有相关性。 如果qmail在邮件队列(本地或远程)中有其他邮件,速度将下降。 如果邮件队列是空的,PHP邮件()需要大约。 一秒钟,当有更多的邮件邮件邮件需要10-60秒。 如果我两次调用php脚本,第一个邮件将会发送得更快,第二个邮件发送更慢。

在邮件stream量高的时候,延迟会增加。 如果邮件是从web应用程序或外部邮件客户端创build的,则不重要。

我检查了名称服务器,反向DNS,如果qmail将启动与-Rt0参数。 没有证书参与。 一些邮箱是6演出大。

我没有更改qmail的并发设置,因为即使邮件队列中只有一个邮件,也会出现问题。 而第一封邮件也不慢,只有一秒钟。

/ var / qmail / handlers / spool中有〜200个月大的邮件。

有人知道什么是错的?

用PHPtesting:

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

用qmail-inject构build/testing:

 h14xxxxx:~ # date; echo to: [email protected] | /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: [email protected] | /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: [email protected] | /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: [email protected] | /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]: [email protected] Feb 16 13:24:24 h14xxxxx qmail-queue-handlers[19931]: [email protected] 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] = '[email protected]' Feb 16 13:24:24 h14xxxxx qmail-queue-handlers[19931]: handlers dir = '/var/qmail//handlers/before-queue/recipient/[email protected]' 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 <[email protected]> qp 19932 uid 0 Feb 16 13:24:25 h14xxxxx qmail: 1329395065.856861 starting delivery 46: msg 9850236 to local [email protected] 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]: [email protected] Feb 16 13:24:26 h14xxxxx qmail-local-handlers[19934]: [email protected] Feb 16 13:24:26 h14xxxxx qmail-queue-handlers[19938]: [email protected] 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]: [email protected] 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] = '[email protected]' 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/[email protected]' 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 <[email protected]> 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]: [email protected] Feb 16 13:24:30 h14xxxxx qmail: 1329395070.264613 starting delivery 47: msg 9850184 to local [email protected] Feb 16 13:24:30 h14xxxxx qmail-local-handlers[19944]: [email protected] Feb 16 13:24:30 h14xxxxx qmail-queue-handlers[19948]: [email protected] 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]: [email protected] 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] = '[email protected]' 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/[email protected]' 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 <[email protected]> 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 [email protected] 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]: [email protected] Feb 16 13:24:37 h14xxxxx qmail-local-handlers[19954]: [email protected] Feb 16 13:24:37 h14xxxxx qmail-queue-handlers[19958]: [email protected] 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]: [email protected] 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] = '[email protected]' Feb 16 13:24:39 h14xxxxx qmail-queue-handlers[19958]: handlers dir = '/var/qmail//handlers/before-queue/recipient/[email protected]' 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 <[email protected]> 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 [email protected] 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]: [email protected] Feb 16 13:24:41 h14xxxxx qmail-local-handlers[19964]: [email protected] 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的/控制/我

 h14xxxxx.stratoserver.net 

在/ var / qmail的/控制/当地人

 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 - 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