Contact Forms slow - not php mail issue

weevilofdoom - September 22, 2009 - 17:35

I've got a problem with the Contact Forms module - it is very slow (Taking 25s or more to complete) - I first figured it might be a DNS or mail server problem - so I checked DNS - no problems resolving, I checked the php mail function itself through the server - no problem, less than 1 second to execute.

Anybody have any idea what this module does behind the scenes besides send an email? It seems to take a very very long time.

I _know_ it's not mail configuration. Here's my php.ini snippet for sendmail_path:

sendmail_path = /usr/sbin/sendmail -t -i -odb

the -odb sets the deliverymode to asynchronous - so it returns very fast from the function.

Here's an example of me sending an email outside of drupal contact forms:

php -e mailtest.php
1253639930
1253639930

As you can see, it takes less than 1s to execute and return.

The code looks like such:

<?php
print time() . "\n";
mail('mail@mail.here',"Subject: dur",'dur',"From: mail@mail.here", "-fmail@mail.here" )
                or die(
'FAILED');
print
time() . "\n";
?>

So - I have pretty much proved it is NOT the mail function the module calls itself... any ideas?

Still not sure why this

weevilofdoom - September 23, 2009 - 15:35

Still not sure why this happens yet - it seems to take the bulk of the time processing things before attempting to mail

In this instance, increasing

weevilofdoom - September 23, 2009 - 16:34

In this instance, increasing the php memory limit fixed this issue. I went as far as installing the apd pear module and profiling.

 
 

Drupal is a registered trademark of Dries Buytaert.