Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 25th January 2009, 00:02
marm26 marm26 is offline
Member
 
Join Date: Jan 2009
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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???
Reply With Quote
Sponsored Links
  #2  
Old 25th January 2009, 20:57
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,749 Times in 2,579 Posts
Default

Any errors in Apache's error log (or the web site's error log)?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 25th January 2009, 23:23
marm26 marm26 is offline
Member
 
Join Date: Jan 2009
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No nothing in of any interest in apache or web error log.
Reply With Quote
  #4  
Old 26th January 2009, 14:08
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,749 Times in 2,579 Posts
Default

And in the mail log?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 26th January 2009, 19:32
marm26 marm26 is offline
Member
 
Join Date: Jan 2009
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #6  
Old 27th January 2009, 19:52
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,749 Times in 2,579 Posts
Default

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.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 27th January 2009, 23:37
marm26 marm26 is offline
Member
 
Join Date: Jan 2009
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
Reply With Quote
  #8  
Old 28th January 2009, 01:02
marm26 marm26 is offline
Member
 
Join Date: Jan 2009
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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?
Reply With Quote
  #9  
Old 28th January 2009, 19:43
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,749 Times in 2,579 Posts
Default

You could try to install a PHP opcode cacher like eAccelerator, Xcache, or APC and see if the behaviour changes.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #10  
Old 2nd February 2009, 05:52
marm26 marm26 is offline
Member
 
Join Date: Jan 2009
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

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?
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't login SquirrelMail satimis Server Operation 23 10th June 2008 14:51
ISPConfig virtual web pages not working mike_phi Installation/Configuration 8 7th May 2008 17:51
Core 4: Error Messages on Fresh Install re CTX/SSL jjw Installation/Configuration 30 6th September 2006 13:16
Downgrade php5 to php4.4.2 llizards Installation/Configuration 4 14th March 2006 00:58


All times are GMT +2. The time now is 08:52.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.