
24th January 2009, 23:02
|
|
Member
|
|
Join Date: Jan 2009
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
php mail() very slow on centos 5.2 with postfix
I am running a centos 5.2 server with postfix and php 5 installed.
I am having problems with php mail(). Mails are sent but it takes about a minute for the page with the mail() function in it to load.
The mails are very short and text only. I had the same script on a different server before (shared hosting) were things just worked perfectly and very fast. I suspect that there is a problem with my server settings. Any ideas???
|

25th January 2009, 19:57
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,685
Thanks: 1,899
Thanked 2,599 Times in 2,448 Posts
|
|
Any errors in Apache's error log (or the web site's error log)?
|

25th January 2009, 22:23
|
|
Member
|
|
Join Date: Jan 2009
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
No nothing in of any interest in apache or web error log.
|

26th January 2009, 13:08
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,685
Thanks: 1,899
Thanked 2,599 Times in 2,448 Posts
|
|
And in the mail log?
|

26th January 2009, 18:32
|
|
Member
|
|
Join Date: Jan 2009
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
ok here is the mail log. Not sure if this helps.
Quote:
Jan 25 05:27:31 ess000665 freshclam[3343]: Received signal: wake up
Jan 25 05:27:31 ess000665 freshclam[3343]: ClamAV update process started at Sun Jan 25 05:27:31 2009
Jan 25 05:27:51 ess000665 freshclam[3343]: Can't query current.cvd.clamav.net
Jan 25 05:27:51 ess000665 freshclam[3343]: Invalid DNS reply. Falling back to HTTP mode.
Jan 25 05:27:51 ess000665 freshclam[3343]: Reading CVD header (main.cvd):
Jan 25 05:28:51 ess000665 freshclam[3343]: Can't get information about database.clamav.net: Temporary failure in name resolution
Jan 25 05:28:51 ess000665 freshclam[3343]: Can't read main.cvd header from database.clamav.net (IP: )
Jan 25 05:28:51 ess000665 freshclam[3343]: Trying again in 5 secs...
Jan 25 05:28:56 ess000665 freshclam[3343]: ClamAV update process started at Sun Jan 25 05:28:56 2009
Jan 25 05:29:16 ess000665 freshclam[3343]: Can't query current.cvd.clamav.net
Jan 25 05:29:16 ess000665 freshclam[3343]: Invalid DNS reply. Falling back to HTTP mode.
Jan 25 05:29:16 ess000665 freshclam[3343]: Reading CVD header (main.cvd):
Jan 25 05:29:56 ess000665 freshclam[3343]: Can't get information about database.clamav.net: Temporary failure in name resolution
Jan 25 05:29:56 ess000665 freshclam[3343]: Can't read main.cvd header from database.clamav.net (IP: )
Jan 25 05:29:56 ess000665 freshclam[3343]: Trying again in 5 secs...
Jan 25 05:30:01 ess000665 freshclam[3343]: ClamAV update process started at Sun Jan 25 05:30:01 2009
Jan 25 05:30:01 ess000665 freshclam[3343]: main.cvd is up to date (version: 49, sigs: 437972, f-level: 35, builder: sven)
Jan 25 05:30:01 ess000665 freshclam[3343]: daily.cld is up to date (version: 8901, sigs: 61185, f-level: 38, builder: edwin)
Jan 25 05:30:01 ess000665 freshclam[3343]: --------------------------------------
Jan 25 07:27:08 ess000665 postfix/smtpd[9603]: connect from unknown[124.11.132.104]
Jan 25 07:27:08 ess000665 postfix/smtpd[9603]: NOQUEUE: reject: RCPT from unknown[124.11.132.104]: 554 5.7.1 <bibiorm@gmail.com>: Relay access denied; from=<millie520@gmail.com> to=<bibiorm@gmail.com> proto=SMTP helo=<209.139.208.129>
Jan 25 07:27:08 ess000665 postfix/smtpd[9603]: lost connection after RCPT from unknown[124.11.132.104]
Jan 25 07:27:08 ess000665 postfix/smtpd[9603]: disconnect from unknown[124.11.132.104]
Jan 25 07:30:28 ess000665 postfix/anvil[9607]: statistics: max connection rate 1/60s for (smtp:124.11.132.104) at Jan 25 07:27:08
Jan 25 07:30:28 ess000665 postfix/anvil[9607]: statistics: max connection count 1 for (smtp:124.11.132.104) at Jan 25 07:27:08
Jan 25 07:30:28 ess000665 postfix/anvil[9607]: statistics: max cache size 1 at Jan 25 07:27:08
Jan 25 07:54:01 ess000665 freshclam[3343]: Received signal: wake up
Jan 25 07:54:01 ess000665 freshclam[3343]: ClamAV update process started at Sun Jan 25 07:54:01 2009
Jan 25 07:54:21 ess000665 freshclam[3343]: Can't query current.cvd.clamav.net
Jan 25 07:54:21 ess000665 freshclam[3343]: Invalid DNS reply. Falling back to HTTP mode.
Jan 25 07:54:21 ess000665 freshclam[3343]: Reading CVD header (main.cvd):
Jan 25 07:55:01 ess000665 freshclam[3343]: Can't get information about database.clamav.net: Temporary failure in name resolution
Jan 25 07:55:01 ess000665 freshclam[3343]: Can't read main.cvd header from database.clamav.net (IP: )
Jan 25 07:55:01 ess000665 freshclam[3343]: Trying again in 5 secs...
Jan 25 07:55:06 ess000665 freshclam[3343]: ClamAV update process started at Sun Jan 25 07:55:06 2009
Jan 25 07:55:06 ess000665 freshclam[3343]: main.cvd is up to date (version: 49, sigs: 437972, f-level: 35, builder: sven)
Jan 25 07:55:06 ess000665 freshclam[3343]: daily.cld is up to date (version: 8901, sigs: 61185, f-level: 38, builder: edwin)
Jan 25 07:55:06 ess000665 freshclam[3343]: --------------------------------------
Jan 25 10:19:06 ess000665 freshclam[3343]: Received signal: wake up
Jan 25 10:19:06 ess000665 freshclam[3343]: ClamAV update process started at Sun Jan 25 10:19:06 2009
Jan 25 10:19:21 ess000665 freshclam[3343]: main.cvd is up to date (version: 49, sigs: 437972, f-level: 35, builder: sven)
Jan 25 10:19:21 ess000665 freshclam[3343]: daily.cld is up to date (version: 8901, sigs: 61185, f-level: 38, builder: edwin)
Jan 25 10:19:21 ess000665 freshclam[3343]: --------------------------------------
Jan 25 12:43:21 ess000665 freshclam[3343]: Received signal: wake up
|
|

27th January 2009, 18:52
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,685
Thanks: 1,899
Thanked 2,599 Times in 2,448 Posts
|
|
Can you post an excerpt where you try to send a mail with the PHP mail() function? I don't see anything like that in the excerpt you posted.
|

27th January 2009, 22:37
|
|
Member
|
|
Join Date: Jan 2009
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I have send several mails with the php mail function that day. If there isnt anything in the mail error log that means it didnt throw an error. I mean the mail also got send. Just the script sending the mail is taking a minute or so to send out the mail.
|

28th January 2009, 00:02
|
|
Member
|
|
Join Date: Jan 2009
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
This is so strange. When i send out one mail message and i didnt send one in a while the script is running forever. But once i send this first mail message, the messages i send out right afterwards are sent in no time. Could it be that my mailing server has to be awakened from his winter sleep first before it starts sending mails. After i stop sending mails it seems to go back to sleep again within a few minutes. This is really not very satisfying. Is there anything i can do about that? what is causing this?
|

28th January 2009, 18:43
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,685
Thanks: 1,899
Thanked 2,599 Times in 2,448 Posts
|
|
You could try to install a PHP opcode cacher like eAccelerator, Xcache, or APC and see if the behaviour changes.
|

2nd February 2009, 04:52
|
|
Member
|
|
Join Date: Jan 2009
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I thought I just let you know that I solved the issue. It was the sendmail path in php ini that caused the script to go incredibly slow.
i changed it to:
sendmail_path = /usr/lib/sendmail.postfix -t -i
No the mails fire real fast. However I am having another problem now. In my maillog file I frequently see messages like this:
Feb 1 19:44:29 server1 postfix/smtp[4591]: 88B9F14A81EE: to=<some-name@gmail.com>, relay=none, delay=20, delays=0.02/0.01/20/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=gmail.com type=MX: Host not found, try again)
Same thing happens with yahoo or hotmail. It doesnt happen with every mail but quite often. Any ideas on this one?
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 06:47.
|
Recent comments
1 day 8 hours ago
1 day 11 hours ago
1 day 23 hours ago
2 days 1 hour ago
2 days 5 hours ago
2 days 12 hours ago
2 days 21 hours ago
2 days 23 hours ago
3 days 7 hours ago
3 days 8 hours ago